diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55ac6ac..c40bc61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ name: Tests -on: [push, pull_request] +on: [push] jobs: cs-check: @@ -8,18 +8,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Cache composer - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.composer/cache/ key: composer-ubuntu-${{ github.sha }} - name: Setup - uses: shivammathur/setup-php@2.9.0 + uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: '8.0' extensions: mbstring, fileinfo, json, intl, dom - name: Run composer install @@ -36,19 +36,19 @@ jobs: strategy: max-parallel: 15 matrix: - php-versions: ['7.4', '8.0', '8.1'] + php-versions: ['8.0', '8.1', '8.2'] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Cache composer - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.composer/cache/ key: composer-${{ matrix.php-versions }}-${{ github.sha }} - name: setup - uses: shivammathur/setup-php@2.9.0 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: mbstring, fileinfo, json, intl, dom diff --git a/CHANGELOG.md b/CHANGELOG.md index 10baf8b..be49766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,29 @@ # Changes between versions +## 6.2.0 (2023-04-19) + + * upgrade to `janephp/open-api` 7.4 + * updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#26) in #43 + * support for the newly introduced pagination cursors + * updated descriptions according to the docs + * add `TimeReportsResult.weekly_capacity` and `TimeReportsResult.avatar_url` + * bump the minimum required PHP version + +## 6.1.0 (2022-11-12) + + * updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#22) in #41 + * add support for `User.access_roles` as defined in https://help.getharvest.com/api-v2/users-api/users/users/#access-roles + * remove the now non-working `User.is_admin` and `User.is_project_manager` booleans + * add management of users assigned team mates, as defined in https://help.getharvest.com/api-v2/users-api/users/teammates/ + * add the ability to retrieve message subject and body for specific invoices as defined in https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#retrieve-invoice-message-subject-and-body-for-specific-invoice + ## 6.0.0 (2022-08-04)  - * upgrade to `janephp/open-api` 7.3 - * drop support for PHP <7.4 - * updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#20) - * added `Company.currency_code_display` and `Company.currency_symbol_display` - * several fields of the `User` object have disappeared, due to the [API changes introduced in March](https://www.getharvest.com/blog/new-flexible-permissions#:~:text=The%20API%20has%20been%20updated%20to%20align%20with%20the%20new%20permissions%20features.). + * upgrade to `janephp/open-api` 7.3 + * drop support for PHP <7.4 + * updated the SDK based on the latest [spec updates](jolicode/harvest-openapi-generator#20) + * added `Company.currency_code_display` and `Company.currency_symbol_display` + * several fields of the `User` object have disappeared, due to the [API changes introduced in March](https://www.getharvest.com/blog/new-flexible-permissions#:~:text=The%20API%20has%20been%20updated%20to%20align%20with%20the%20new%20permissions%20features.).  ## 5.2.0 (2022-01-10) diff --git a/Resources/harvest-openapi.yaml b/Resources/harvest-openapi.yaml index 9093f8d..79a55ce 100644 --- a/Resources/harvest-openapi.yaml +++ b/Resources/harvest-openapi.yaml @@ -425,7 +425,7 @@ components: nullable: true client_key: type: string - description: 'Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}' + description: 'Used to build a URL to the public web invoice for your client by adding /client/invoices/{CLIENT_KEY} to your account URL https://{SUBDOMAIN}.harvestapp.com/ Note: you can also add .pdf to the end of this URL to access a PDF version of the invoice.' nullable: true number: type: string @@ -472,7 +472,7 @@ components: format: float discount_amount: type: number - description: 'The amount calcuated from discount.' + description: 'The amount calculated from discount.' nullable: true format: float subject: @@ -796,7 +796,7 @@ components: format: float discount_amount: type: number - description: 'The amount calcuated from discount.' + description: 'The amount calculated from discount.' nullable: true format: float subject: @@ -2016,6 +2016,15 @@ components: type: string description: 'The name of the user associated with the reported hours. Only returned in the Team report.' nullable: true + weekly_capacity: + type: integer + description: 'The number of hours per week this person is available to work in seconds, in half hour increments. For example, if a person’s capacity is 35 hours, the API will return 126000 seconds. Only returned in the Team report.' + nullable: true + format: int32 + avatar_url: + type: string + description: 'The URL to the user’s avatar image. Only returned in the Team report.' + nullable: true is_contractor: type: boolean description: 'The contractor status of the user associated with the reported hours. Only returned in the Team report.' @@ -3406,14 +3415,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -3759,14 +3776,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -4030,14 +4055,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -4356,7 +4389,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -4831,14 +4864,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -5056,14 +5097,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -5439,7 +5488,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -5850,14 +5899,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -6229,7 +6286,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -6319,11 +6376,6 @@ paths: description: 'The ID of the client this invoice belongs to.' nullable: true format: int32 - retainer_id: - type: integer - description: 'The ID of the retainer associated with this invoice.' - nullable: true - format: int32 estimate_id: type: integer description: 'The ID of the estimate associated with this invoice.' @@ -6371,7 +6423,7 @@ paths: format: date due_date: type: string - description: 'Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calucated using the issue_date and the payment_term.' + description: 'Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calculated using the issue_date and the payment_term.' nullable: true format: date payment_term: @@ -6427,6 +6479,11 @@ paths: attach_receipt: type: boolean description: 'If set to true, a PDF containing an expense report with receipts will be attached to the invoice. Defaults to false.' + retainer_id: + type: integer + description: 'The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only avaiable action is to add funds.' + nullable: true + format: int32 line_items: type: array description: 'Array of line item parameters' @@ -6859,14 +6916,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -7134,14 +7199,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -7372,14 +7445,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -7908,7 +7989,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -8263,7 +8344,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -8602,7 +8683,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -8681,7 +8762,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -8764,7 +8845,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -8852,7 +8933,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -8927,7 +9008,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9015,7 +9096,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9109,7 +9190,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9211,7 +9292,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9245,6 +9326,8 @@ paths: billable_hours: 0.5 currency: EUR billable_amount: 50 + weekly_capacity: 126000 + avatar_url: 'https://cache.harvestapp.com/assets/profile_images/abraj_albait_towers.png?1498516481' - user_id: 1782959 user_name: 'Kim Allen' @@ -9253,6 +9336,8 @@ paths: billable_hours: 3 currency: EUR billable_amount: 300 + weekly_capacity: 126000 + avatar_url: 'https://cache.harvestapp.com/assets/profile_images/cornell_clock_tower.png?1498515345' - user_id: 1782959 user_name: 'Kim Allen' @@ -9261,6 +9346,8 @@ paths: billable_hours: 2 currency: USD billable_amount: 200 + weekly_capacity: 126000 + avatar_url: 'https://cache.harvestapp.com/assets/profile_images/allen_bradley_clock_tower.png?1498509661' per_page: 2000 total_pages: 1 total_entries: 3 @@ -9302,7 +9389,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9399,7 +9486,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 1000)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9466,14 +9553,22 @@ paths: parameters: - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -9890,14 +9985,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -10002,14 +10105,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -10541,7 +10652,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -11289,14 +11400,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -11417,14 +11536,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -11758,7 +11885,7 @@ paths: type: integer - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -12034,14 +12161,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -12217,14 +12352,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -12508,14 +12651,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: @@ -12577,14 +12728,22 @@ paths: type: string - name: page - description: 'The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' + description: 'DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)' required: false in: query schema: type: integer + deprecated: true + - + name: cursor + description: 'Pagination cursor' + required: false + in: query + schema: + type: string - name: per_page - description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 100)' + description: 'The number of records to return per page. Can range between 1 and 2000. (Default: 2000)' required: false in: query schema: diff --git a/composer.json b/composer.json index 4ba5738..b1b94d9 100644 --- a/composer.json +++ b/composer.json @@ -22,17 +22,22 @@ } }, "require": { - "php": ">=7.4", - "jane-php/open-api-runtime": "^7.3", + "php": ">=8.0", + "jane-php/open-api-runtime": "^7.4", "php-http/client-implementation": "*", "php-http/client-common": "^1.9 || ^2.0" }, "require-dev": { - "jane-php/open-api-3": "^7.3", + "jane-php/open-api-3": "^7.4", "symfony/http-client": "^5.4 || ^6.0", "nyholm/psr7": "^1.3", "friendsofphp/php-cs-fixer": "^3.2", "symfony/phpunit-bridge": "^5.4 || ^6.0", "symfony/yaml": "^5.4 || ^6.0" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true + } } } diff --git a/generated/Client.php b/generated/Client.php index d733124..0dd4ae5 100644 --- a/generated/Client.php +++ b/generated/Client.php @@ -21,8 +21,9 @@ class Client extends \JoliCode\Harvest\Api\Runtime\Client\Client * * @var bool $is_active pass true to only return active clients and false to return inactive clients * @var string $updated_since only return clients that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -115,8 +116,9 @@ public function updateCompany(Model\CompanyPatchBody $requestBody, string $fetch * * @var int $client_id only return contacts belonging to the client with the given ID * @var string $updated_since only return contacts that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -185,8 +187,9 @@ public function updateContact(string $contactId, Model\ContactsContactIdPatchBod * @param array $queryParameters { * * @var string $updated_since only return estimate item categories that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -260,7 +263,7 @@ public function updateEstimateItemCategory(string $estimateItemCategoryId, Model * @var string $to only return estimates with an issue_date on or before the given date * @var string $state Only return estimates with a state matching the value provided. Options: draft, sent, accepted, or declined. * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -329,8 +332,9 @@ public function updateEstimate(string $estimateId, Model\EstimatesEstimateIdPatc * @param array $queryParameters { * * @var string $updated_since only return estimate messages that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -375,8 +379,9 @@ public function deleteEstimateMessage(string $estimateId, string $messageId, str * * @var bool $is_active pass true to only return active expense categories and false to return inactive expense categories * @var string $updated_since only return expense categories that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -452,7 +457,7 @@ public function updateExpenseCategory(string $expenseCategoryId, Model\ExpenseCa * @var string $from only return expenses with a spent_date on or after the given date * @var string $to only return expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -521,8 +526,9 @@ public function updateExpense(string $expenseId, Model\ExpensesExpenseIdPatchBod * @param array $queryParameters { * * @var string $updated_since only return invoice item categories that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -597,7 +603,7 @@ public function updateInvoiceItemCategory(string $invoiceItemCategoryId, Model\I * @var string $to only return invoices with an issue_date on or before the given date * @var string $state Only return invoices with a state matching the value provided. Options: draft, open, paid, or closed. * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -666,8 +672,9 @@ public function updateInvoice(string $invoiceId, Model\InvoicesInvoiceIdPatchBod * @param array $queryParameters { * * @var string $updated_since only return invoice messages that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -729,8 +736,9 @@ public function deleteInvoiceMessage(string $invoiceId, string $messageId, strin * @param array $queryParameters { * * @var string $updated_since only return invoice payments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -776,8 +784,9 @@ public function deleteInvoicePayment(string $invoiceId, string $paymentId, strin * @var bool $is_active pass true to only return active projects and false to return inactive projects * @var int $client_id only return projects belonging to the client with the given ID * @var string $updated_since only return projects that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -848,7 +857,7 @@ public function updateProject(string $projectId, Model\ProjectsProjectIdPatchBod * @var bool $is_active pass true to only return active task assignments and false to return inactive task assignments * @var string $updated_since only return task assignments that have been updated since the given date and time * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -920,7 +929,7 @@ public function updateTaskAssignment(string $projectId, string $taskAssignmentId * @var bool $is_active pass true to only return active user assignments and false to return inactive user assignments * @var string $updated_since only return user assignments that have been updated since the given date and time * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -988,7 +997,7 @@ public function updateUserAssignment(string $projectId, string $userAssignmentId * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1006,7 +1015,7 @@ public function expenseCategoriesReport(array $queryParameters = [], string $fet * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1024,7 +1033,7 @@ public function clientsExpensesReport(array $queryParameters = [], string $fetch * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1042,7 +1051,7 @@ public function projectsExpensesReport(array $queryParameters = [], string $fetc * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1060,7 +1069,7 @@ public function teamExpensesReport(array $queryParameters = [], string $fetch = * @param array $queryParameters { * * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * @var bool $is_active Pass true to only return active projects and false to return inactive projects. * } * @@ -1079,7 +1088,7 @@ public function projectBudgetReport(array $queryParameters = [], string $fetch = * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1097,7 +1106,7 @@ public function clientsTimeReport(array $queryParameters = [], string $fetch = s * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1115,7 +1124,7 @@ public function projectsTimeReport(array $queryParameters = [], string $fetch = * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1133,7 +1142,7 @@ public function tasksReport(array $queryParameters = [], string $fetch = self::F * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1154,7 +1163,7 @@ public function teamTimeReport(array $queryParameters = [], string $fetch = self * @var string $from only report on time entries and expenses with a spent_date on or after the given date * @var string $to only report on time entries and expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1172,8 +1181,9 @@ public function uninvoicedReport(array $queryParameters = [], string $fetch = se * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1243,8 +1253,9 @@ public function updateRole(string $roleId, Model\RolesRoleIdPatchBody $requestBo * * @var bool $is_active pass true to only return active task assignments and false to return inactive task assignments * @var string $updated_since only return task assignments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1264,8 +1275,9 @@ public function listTaskAssignments(array $queryParameters = [], string $fetch = * * @var bool $is_active pass true to only return active tasks and false to return inactive tasks * @var string $updated_since only return tasks that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1344,7 +1356,7 @@ public function updateTask(string $taskId, Model\TasksTaskIdPatchBody $requestBo * @var string $from only return time entries with a spent_date on or after the given date * @var string $to only return time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1452,8 +1464,9 @@ public function stopRunningTimeEntry(string $timeEntryId, string $fetch = self:: * @var int $user_id only return user assignments belonging to the user with the given ID * @var bool $is_active pass true to only return active user assignments and false to return inactive user assignments * @var string $updated_since only return user assignments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1473,8 +1486,9 @@ public function listUserAssignments(array $queryParameters = [], string $fetch = * * @var bool $is_active pass true to only return active users and false to return inactive users * @var string $updated_since only return users that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1516,7 +1530,7 @@ public function retrieveTheCurrentlyAuthenticatedUser(string $fetch = self::FETC * @param array $queryParameters { * * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1571,8 +1585,9 @@ public function updateUser(string $userId, Model\UsersUserIdPatchBody $requestBo * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1617,8 +1632,9 @@ public function retrieveBillableRate(string $userId, string $billableRateId, str * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1664,8 +1680,9 @@ public function retrieveCostRate(string $userId, string $costRateId, string $fet * @param array $queryParameters { * * @var string $updated_since only return project assignments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) @@ -1683,8 +1700,9 @@ public function listActiveProjectAssignments(string $userId, array $queryParamet * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) diff --git a/generated/Endpoint/ClientsExpensesReport.php b/generated/Endpoint/ClientsExpensesReport.php index f3d5d08..d5bee6a 100644 --- a/generated/Endpoint/ClientsExpensesReport.php +++ b/generated/Endpoint/ClientsExpensesReport.php @@ -21,7 +21,7 @@ class ClientsExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEnd * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } diff --git a/generated/Endpoint/ClientsTimeReport.php b/generated/Endpoint/ClientsTimeReport.php index 24d3cee..10342e1 100644 --- a/generated/Endpoint/ClientsTimeReport.php +++ b/generated/Endpoint/ClientsTimeReport.php @@ -21,7 +21,7 @@ class ClientsTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoin * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } diff --git a/generated/Endpoint/CreateBillableRate.php b/generated/Endpoint/CreateBillableRate.php index 767d828..accdea9 100644 --- a/generated/Endpoint/CreateBillableRate.php +++ b/generated/Endpoint/CreateBillableRate.php @@ -62,8 +62,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json'); } diff --git a/generated/Endpoint/CreateClient.php b/generated/Endpoint/CreateClient.php index 387df68..61b1d4c 100644 --- a/generated/Endpoint/CreateClient.php +++ b/generated/Endpoint/CreateClient.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json'); } diff --git a/generated/Endpoint/CreateContact.php b/generated/Endpoint/CreateContact.php index c668f7b..2a52e57 100644 --- a/generated/Endpoint/CreateContact.php +++ b/generated/Endpoint/CreateContact.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json'); } diff --git a/generated/Endpoint/CreateCostRate.php b/generated/Endpoint/CreateCostRate.php index 453df79..702ff90 100644 --- a/generated/Endpoint/CreateCostRate.php +++ b/generated/Endpoint/CreateCostRate.php @@ -62,8 +62,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json'); } diff --git a/generated/Endpoint/CreateEstimate.php b/generated/Endpoint/CreateEstimate.php index b4ec151..fb55065 100644 --- a/generated/Endpoint/CreateEstimate.php +++ b/generated/Endpoint/CreateEstimate.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json'); } diff --git a/generated/Endpoint/CreateEstimateItemCategory.php b/generated/Endpoint/CreateEstimateItemCategory.php index b93067b..e3a9708 100644 --- a/generated/Endpoint/CreateEstimateItemCategory.php +++ b/generated/Endpoint/CreateEstimateItemCategory.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json'); } diff --git a/generated/Endpoint/CreateEstimateMessage.php b/generated/Endpoint/CreateEstimateMessage.php index bdf781e..c79fcf1 100644 --- a/generated/Endpoint/CreateEstimateMessage.php +++ b/generated/Endpoint/CreateEstimateMessage.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\EstimateMessage|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage', 'json'); } diff --git a/generated/Endpoint/CreateExpense.php b/generated/Endpoint/CreateExpense.php index 6d6d55d..9c41f28 100644 --- a/generated/Endpoint/CreateExpense.php +++ b/generated/Endpoint/CreateExpense.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json'); } diff --git a/generated/Endpoint/CreateExpenseCategory.php b/generated/Endpoint/CreateExpenseCategory.php index 6f04cb2..cf2bed5 100644 --- a/generated/Endpoint/CreateExpenseCategory.php +++ b/generated/Endpoint/CreateExpenseCategory.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json'); } diff --git a/generated/Endpoint/CreateInvoice.php b/generated/Endpoint/CreateInvoice.php index 425ffe6..8747d28 100644 --- a/generated/Endpoint/CreateInvoice.php +++ b/generated/Endpoint/CreateInvoice.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json'); } diff --git a/generated/Endpoint/CreateInvoiceItemCategory.php b/generated/Endpoint/CreateInvoiceItemCategory.php index 94d0958..890100d 100644 --- a/generated/Endpoint/CreateInvoiceItemCategory.php +++ b/generated/Endpoint/CreateInvoiceItemCategory.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json'); } diff --git a/generated/Endpoint/CreateInvoiceMessage.php b/generated/Endpoint/CreateInvoiceMessage.php index e9f54d3..6d5e036 100644 --- a/generated/Endpoint/CreateInvoiceMessage.php +++ b/generated/Endpoint/CreateInvoiceMessage.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\InvoiceMessage|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage', 'json'); } diff --git a/generated/Endpoint/CreateInvoicePayment.php b/generated/Endpoint/CreateInvoicePayment.php index 1efb950..2669f70 100644 --- a/generated/Endpoint/CreateInvoicePayment.php +++ b/generated/Endpoint/CreateInvoicePayment.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\InvoicePayment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment', 'json'); } diff --git a/generated/Endpoint/CreateProject.php b/generated/Endpoint/CreateProject.php index bff939e..5f74192 100644 --- a/generated/Endpoint/CreateProject.php +++ b/generated/Endpoint/CreateProject.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json'); } diff --git a/generated/Endpoint/CreateRole.php b/generated/Endpoint/CreateRole.php index a768745..1a46658 100644 --- a/generated/Endpoint/CreateRole.php +++ b/generated/Endpoint/CreateRole.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json'); } diff --git a/generated/Endpoint/CreateTask.php b/generated/Endpoint/CreateTask.php index 9c2ab89..33426e4 100644 --- a/generated/Endpoint/CreateTask.php +++ b/generated/Endpoint/CreateTask.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json'); } diff --git a/generated/Endpoint/CreateTaskAssignment.php b/generated/Endpoint/CreateTaskAssignment.php index 979e988..2bf6855 100644 --- a/generated/Endpoint/CreateTaskAssignment.php +++ b/generated/Endpoint/CreateTaskAssignment.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json'); } diff --git a/generated/Endpoint/CreateTimeEntry.php b/generated/Endpoint/CreateTimeEntry.php index 1c0ae8f..b86729e 100644 --- a/generated/Endpoint/CreateTimeEntry.php +++ b/generated/Endpoint/CreateTimeEntry.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } diff --git a/generated/Endpoint/CreateUser.php b/generated/Endpoint/CreateUser.php index 5fce821..fc9dd2b 100644 --- a/generated/Endpoint/CreateUser.php +++ b/generated/Endpoint/CreateUser.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } diff --git a/generated/Endpoint/CreateUserAssignment.php b/generated/Endpoint/CreateUserAssignment.php index 4cc42b4..95034aa 100644 --- a/generated/Endpoint/CreateUserAssignment.php +++ b/generated/Endpoint/CreateUserAssignment.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json'); } diff --git a/generated/Endpoint/DeleteClient.php b/generated/Endpoint/DeleteClient.php index 8cc5a61..84fe9dd 100644 --- a/generated/Endpoint/DeleteClient.php +++ b/generated/Endpoint/DeleteClient.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteContact.php b/generated/Endpoint/DeleteContact.php index 2a5cc13..cd210ca 100644 --- a/generated/Endpoint/DeleteContact.php +++ b/generated/Endpoint/DeleteContact.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteEstimate.php b/generated/Endpoint/DeleteEstimate.php index 18e7780..6f715ac 100644 --- a/generated/Endpoint/DeleteEstimate.php +++ b/generated/Endpoint/DeleteEstimate.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteEstimateItemCategory.php b/generated/Endpoint/DeleteEstimateItemCategory.php index e5e1e02..8907951 100644 --- a/generated/Endpoint/DeleteEstimateItemCategory.php +++ b/generated/Endpoint/DeleteEstimateItemCategory.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteEstimateMessage.php b/generated/Endpoint/DeleteEstimateMessage.php index 1db2e6e..bd6e925 100644 --- a/generated/Endpoint/DeleteEstimateMessage.php +++ b/generated/Endpoint/DeleteEstimateMessage.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteExpense.php b/generated/Endpoint/DeleteExpense.php index 079cadb..02265a1 100644 --- a/generated/Endpoint/DeleteExpense.php +++ b/generated/Endpoint/DeleteExpense.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteExpenseCategory.php b/generated/Endpoint/DeleteExpenseCategory.php index c0f86cc..9de3bc6 100644 --- a/generated/Endpoint/DeleteExpenseCategory.php +++ b/generated/Endpoint/DeleteExpenseCategory.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteInvoice.php b/generated/Endpoint/DeleteInvoice.php index f4dd032..07baf7e 100644 --- a/generated/Endpoint/DeleteInvoice.php +++ b/generated/Endpoint/DeleteInvoice.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteInvoiceItemCategory.php b/generated/Endpoint/DeleteInvoiceItemCategory.php index 7b7cc83..b524ade 100644 --- a/generated/Endpoint/DeleteInvoiceItemCategory.php +++ b/generated/Endpoint/DeleteInvoiceItemCategory.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteInvoiceMessage.php b/generated/Endpoint/DeleteInvoiceMessage.php index 3cef62a..afa73bd 100644 --- a/generated/Endpoint/DeleteInvoiceMessage.php +++ b/generated/Endpoint/DeleteInvoiceMessage.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteInvoicePayment.php b/generated/Endpoint/DeleteInvoicePayment.php index 1cae053..216f45e 100644 --- a/generated/Endpoint/DeleteInvoicePayment.php +++ b/generated/Endpoint/DeleteInvoicePayment.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteProject.php b/generated/Endpoint/DeleteProject.php index fc86404..112f22b 100644 --- a/generated/Endpoint/DeleteProject.php +++ b/generated/Endpoint/DeleteProject.php @@ -55,8 +55,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteRole.php b/generated/Endpoint/DeleteRole.php index 3db748a..690e470 100644 --- a/generated/Endpoint/DeleteRole.php +++ b/generated/Endpoint/DeleteRole.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteTask.php b/generated/Endpoint/DeleteTask.php index 62cce1a..150760a 100644 --- a/generated/Endpoint/DeleteTask.php +++ b/generated/Endpoint/DeleteTask.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteTaskAssignment.php b/generated/Endpoint/DeleteTaskAssignment.php index a38e568..93dc9d4 100644 --- a/generated/Endpoint/DeleteTaskAssignment.php +++ b/generated/Endpoint/DeleteTaskAssignment.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteTimeEntry.php b/generated/Endpoint/DeleteTimeEntry.php index 932cd6e..781e989 100644 --- a/generated/Endpoint/DeleteTimeEntry.php +++ b/generated/Endpoint/DeleteTimeEntry.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteTimeEntryExternalReference.php b/generated/Endpoint/DeleteTimeEntryExternalReference.php index 27dfeca..3819ddd 100644 --- a/generated/Endpoint/DeleteTimeEntryExternalReference.php +++ b/generated/Endpoint/DeleteTimeEntryExternalReference.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteUser.php b/generated/Endpoint/DeleteUser.php index 0d18dac..cf3f54a 100644 --- a/generated/Endpoint/DeleteUser.php +++ b/generated/Endpoint/DeleteUser.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/DeleteUserAssignment.php b/generated/Endpoint/DeleteUserAssignment.php index 3688cdd..0355a81 100644 --- a/generated/Endpoint/DeleteUserAssignment.php +++ b/generated/Endpoint/DeleteUserAssignment.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if (200 === $status) { return null; } diff --git a/generated/Endpoint/ExpenseCategoriesReport.php b/generated/Endpoint/ExpenseCategoriesReport.php index c221ee3..d02fe28 100644 --- a/generated/Endpoint/ExpenseCategoriesReport.php +++ b/generated/Endpoint/ExpenseCategoriesReport.php @@ -21,7 +21,7 @@ class ExpenseCategoriesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseE * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } diff --git a/generated/Endpoint/ListActiveProjectAssignments.php b/generated/Endpoint/ListActiveProjectAssignments.php index 1180e0e..3bb154c 100644 --- a/generated/Endpoint/ListActiveProjectAssignments.php +++ b/generated/Endpoint/ListActiveProjectAssignments.php @@ -23,8 +23,9 @@ class ListActiveProjectAssignments extends \JoliCode\Harvest\Api\Runtime\Client\ * @param array $queryParameters { * * @var string $updated_since only return project assignments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $userId, array $queryParameters = []) @@ -61,12 +62,13 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -76,8 +78,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments', 'json'); } diff --git a/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php b/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php index 42db8be..e490684 100644 --- a/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php +++ b/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php @@ -22,7 +22,7 @@ class ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser extends \Joli * @param array $queryParameters { * * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -61,8 +61,8 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -72,8 +72,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments', 'json'); } diff --git a/generated/Endpoint/ListAssignedTeammatesForSpecificUser.php b/generated/Endpoint/ListAssignedTeammatesForSpecificUser.php index bef1a9c..2cf9b7e 100644 --- a/generated/Endpoint/ListAssignedTeammatesForSpecificUser.php +++ b/generated/Endpoint/ListAssignedTeammatesForSpecificUser.php @@ -22,8 +22,9 @@ class ListAssignedTeammatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $userId, array $queryParameters = []) @@ -60,11 +61,12 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setDefined(['page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -74,8 +76,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Teammates|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Teammates', 'json'); } diff --git a/generated/Endpoint/ListBillableRatesForSpecificUser.php b/generated/Endpoint/ListBillableRatesForSpecificUser.php index 99bb9a8..c86221a 100644 --- a/generated/Endpoint/ListBillableRatesForSpecificUser.php +++ b/generated/Endpoint/ListBillableRatesForSpecificUser.php @@ -22,8 +22,9 @@ class ListBillableRatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Cli * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $userId, array $queryParameters = []) @@ -60,11 +61,12 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setDefined(['page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -74,8 +76,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\BillableRates|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRates', 'json'); } diff --git a/generated/Endpoint/ListClients.php b/generated/Endpoint/ListClients.php index accde55..c6b6fea 100644 --- a/generated/Endpoint/ListClients.php +++ b/generated/Endpoint/ListClients.php @@ -23,8 +23,9 @@ class ListClients extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint impl * * @var bool $is_active pass true to only return active clients and false to return inactive clients * @var string $updated_since only return clients that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,14 +61,15 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -77,8 +79,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Clients|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Clients', 'json'); } diff --git a/generated/Endpoint/ListContacts.php b/generated/Endpoint/ListContacts.php index 0f51638..c1142e0 100644 --- a/generated/Endpoint/ListContacts.php +++ b/generated/Endpoint/ListContacts.php @@ -23,8 +23,9 @@ class ListContacts extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp * * @var int $client_id only return contacts belonging to the client with the given ID * @var string $updated_since only return contacts that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,13 +61,14 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['client_id', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['client_id', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('client_id', ['int']); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('client_id', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -76,8 +78,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Contacts|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contacts', 'json'); } diff --git a/generated/Endpoint/ListCostRatesForSpecificUser.php b/generated/Endpoint/ListCostRatesForSpecificUser.php index 51a2f3e..52b9eea 100644 --- a/generated/Endpoint/ListCostRatesForSpecificUser.php +++ b/generated/Endpoint/ListCostRatesForSpecificUser.php @@ -22,8 +22,9 @@ class ListCostRatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Client\ * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $userId, array $queryParameters = []) @@ -60,11 +61,12 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setDefined(['page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -74,8 +76,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\CostRates|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRates', 'json'); } diff --git a/generated/Endpoint/ListEstimateItemCategories.php b/generated/Endpoint/ListEstimateItemCategories.php index a780b60..44e72cf 100644 --- a/generated/Endpoint/ListEstimateItemCategories.php +++ b/generated/Endpoint/ListEstimateItemCategories.php @@ -22,8 +22,9 @@ class ListEstimateItemCategories extends \JoliCode\Harvest\Api\Runtime\Client\Ba * @param array $queryParameters { * * @var string $updated_since only return estimate item categories that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -59,12 +60,13 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -74,8 +76,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\EstimateItemCategories|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories', 'json'); } diff --git a/generated/Endpoint/ListEstimates.php b/generated/Endpoint/ListEstimates.php index 184d72b..38608a8 100644 --- a/generated/Endpoint/ListEstimates.php +++ b/generated/Endpoint/ListEstimates.php @@ -27,7 +27,7 @@ class ListEstimates extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint im * @var string $to only return estimates with an issue_date on or before the given date * @var string $state Only return estimates with a state matching the value provided. Options: draft, sent, accepted, or declined. * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -66,13 +66,13 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['client_id', 'updated_since', 'from', 'to', 'state', 'page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('client_id', ['int']); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('state', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('client_id', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('state', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -82,8 +82,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Estimates|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimates', 'json'); } diff --git a/generated/Endpoint/ListExpenseCategories.php b/generated/Endpoint/ListExpenseCategories.php index c5cc6d6..d1f3b8e 100644 --- a/generated/Endpoint/ListExpenseCategories.php +++ b/generated/Endpoint/ListExpenseCategories.php @@ -23,8 +23,9 @@ class ListExpenseCategories extends \JoliCode\Harvest\Api\Runtime\Client\BaseEnd * * @var bool $is_active pass true to only return active expense categories and false to return inactive expense categories * @var string $updated_since only return expense categories that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,14 +61,15 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -77,8 +79,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ExpenseCategories|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories', 'json'); } diff --git a/generated/Endpoint/ListExpenses.php b/generated/Endpoint/ListExpenses.php index c42684e..131fc9d 100644 --- a/generated/Endpoint/ListExpenses.php +++ b/generated/Endpoint/ListExpenses.php @@ -29,7 +29,7 @@ class ListExpenses extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp * @var string $from only return expenses with a spent_date on or after the given date * @var string $to only return expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -68,16 +68,16 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['user_id', 'client_id', 'project_id', 'is_billed', 'updated_since', 'from', 'to', 'page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('user_id', ['int']); - $optionsResolver->setAllowedTypes('client_id', ['int']); - $optionsResolver->setAllowedTypes('project_id', ['int']); - $optionsResolver->setAllowedTypes('is_billed', ['bool']); + $optionsResolver->addAllowedTypes('user_id', ['int']); + $optionsResolver->addAllowedTypes('client_id', ['int']); + $optionsResolver->addAllowedTypes('project_id', ['int']); + $optionsResolver->addAllowedTypes('is_billed', ['bool']); $optionsResolver->setNormalizer('is_billed', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -87,8 +87,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Expenses|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expenses', 'json'); } diff --git a/generated/Endpoint/ListInvoiceItemCategories.php b/generated/Endpoint/ListInvoiceItemCategories.php index 6a6f76a..bfc5495 100644 --- a/generated/Endpoint/ListInvoiceItemCategories.php +++ b/generated/Endpoint/ListInvoiceItemCategories.php @@ -22,8 +22,9 @@ class ListInvoiceItemCategories extends \JoliCode\Harvest\Api\Runtime\Client\Bas * @param array $queryParameters { * * @var string $updated_since only return invoice item categories that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -59,12 +60,13 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -74,8 +76,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategories|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories', 'json'); } diff --git a/generated/Endpoint/ListInvoices.php b/generated/Endpoint/ListInvoices.php index 3ac26b1..234a600 100644 --- a/generated/Endpoint/ListInvoices.php +++ b/generated/Endpoint/ListInvoices.php @@ -28,7 +28,7 @@ class ListInvoices extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp * @var string $to only return invoices with an issue_date on or before the given date * @var string $state Only return invoices with a state matching the value provided. Options: draft, open, paid, or closed. * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -67,14 +67,14 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['client_id', 'project_id', 'updated_since', 'from', 'to', 'state', 'page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('client_id', ['int']); - $optionsResolver->setAllowedTypes('project_id', ['int']); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('state', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('client_id', ['int']); + $optionsResolver->addAllowedTypes('project_id', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('state', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -84,8 +84,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Invoices|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoices', 'json'); } diff --git a/generated/Endpoint/ListMessagesForEstimate.php b/generated/Endpoint/ListMessagesForEstimate.php index 47b6dc5..041c5b8 100644 --- a/generated/Endpoint/ListMessagesForEstimate.php +++ b/generated/Endpoint/ListMessagesForEstimate.php @@ -23,8 +23,9 @@ class ListMessagesForEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseE * @param array $queryParameters { * * @var string $updated_since only return estimate messages that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $estimateId, array $queryParameters = []) @@ -61,12 +62,13 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -76,8 +78,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\EstimateMessages|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages', 'json'); } diff --git a/generated/Endpoint/ListMessagesForInvoice.php b/generated/Endpoint/ListMessagesForInvoice.php index 8116b82..f50661a 100644 --- a/generated/Endpoint/ListMessagesForInvoice.php +++ b/generated/Endpoint/ListMessagesForInvoice.php @@ -23,8 +23,9 @@ class ListMessagesForInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEn * @param array $queryParameters { * * @var string $updated_since only return invoice messages that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $invoiceId, array $queryParameters = []) @@ -61,12 +62,13 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -76,8 +78,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\InvoiceMessages|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages', 'json'); } diff --git a/generated/Endpoint/ListPaymentsForInvoice.php b/generated/Endpoint/ListPaymentsForInvoice.php index e6834c5..2d5fc0e 100644 --- a/generated/Endpoint/ListPaymentsForInvoice.php +++ b/generated/Endpoint/ListPaymentsForInvoice.php @@ -23,8 +23,9 @@ class ListPaymentsForInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEn * @param array $queryParameters { * * @var string $updated_since only return invoice payments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $invoiceId, array $queryParameters = []) @@ -61,12 +62,13 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -76,8 +78,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\InvoicePayments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments', 'json'); } diff --git a/generated/Endpoint/ListProjects.php b/generated/Endpoint/ListProjects.php index 7cec9d8..fee2d2f 100644 --- a/generated/Endpoint/ListProjects.php +++ b/generated/Endpoint/ListProjects.php @@ -24,8 +24,9 @@ class ListProjects extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint imp * @var bool $is_active pass true to only return active projects and false to return inactive projects * @var int $client_id only return projects belonging to the client with the given ID * @var string $updated_since only return projects that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -61,15 +62,16 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['is_active', 'client_id', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['is_active', 'client_id', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('client_id', ['int']); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('client_id', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -79,8 +81,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Projects|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Projects', 'json'); } diff --git a/generated/Endpoint/ListRoles.php b/generated/Endpoint/ListRoles.php index b45a4d6..442f4db 100644 --- a/generated/Endpoint/ListRoles.php +++ b/generated/Endpoint/ListRoles.php @@ -21,8 +21,9 @@ class ListRoles extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implem * * @param array $queryParameters { * - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -58,11 +59,12 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setDefined(['page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -72,8 +74,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Roles|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Roles', 'json'); } diff --git a/generated/Endpoint/ListTaskAssignments.php b/generated/Endpoint/ListTaskAssignments.php index 4fe6748..a6a4d39 100644 --- a/generated/Endpoint/ListTaskAssignments.php +++ b/generated/Endpoint/ListTaskAssignments.php @@ -23,8 +23,9 @@ class ListTaskAssignments extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpo * * @var bool $is_active pass true to only return active task assignments and false to return inactive task assignments * @var string $updated_since only return task assignments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,14 +61,15 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -77,8 +79,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments', 'json'); } diff --git a/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php b/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php index 46751ec..561f623 100644 --- a/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php +++ b/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php @@ -25,7 +25,7 @@ class ListTaskAssignmentsForSpecificProject extends \JoliCode\Harvest\Api\Runtim * @var bool $is_active pass true to only return active task assignments and false to return inactive task assignments * @var string $updated_since only return task assignments that have been updated since the given date and time * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $projectId, array $queryParameters = []) @@ -65,11 +65,11 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -79,8 +79,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments', 'json'); } diff --git a/generated/Endpoint/ListTasks.php b/generated/Endpoint/ListTasks.php index 9f8bd1e..53e1826 100644 --- a/generated/Endpoint/ListTasks.php +++ b/generated/Endpoint/ListTasks.php @@ -23,8 +23,9 @@ class ListTasks extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implem * * @var bool $is_active pass true to only return active tasks and false to return inactive tasks * @var string $updated_since only return tasks that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,14 +61,15 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -77,8 +79,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Tasks|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Tasks', 'json'); } diff --git a/generated/Endpoint/ListTimeEntries.php b/generated/Endpoint/ListTimeEntries.php index 3ba02ca..2e84c21 100644 --- a/generated/Endpoint/ListTimeEntries.php +++ b/generated/Endpoint/ListTimeEntries.php @@ -32,7 +32,7 @@ class ListTimeEntries extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint * @var string $from only return time entries with a spent_date on or after the given date * @var string $to only return time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -71,20 +71,20 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['user_id', 'client_id', 'project_id', 'task_id', 'external_reference_id', 'is_billed', 'is_running', 'updated_since', 'from', 'to', 'page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('user_id', ['int']); - $optionsResolver->setAllowedTypes('client_id', ['int']); - $optionsResolver->setAllowedTypes('project_id', ['int']); - $optionsResolver->setAllowedTypes('task_id', ['int']); - $optionsResolver->setAllowedTypes('external_reference_id', ['string']); - $optionsResolver->setAllowedTypes('is_billed', ['bool']); + $optionsResolver->addAllowedTypes('user_id', ['int']); + $optionsResolver->addAllowedTypes('client_id', ['int']); + $optionsResolver->addAllowedTypes('project_id', ['int']); + $optionsResolver->addAllowedTypes('task_id', ['int']); + $optionsResolver->addAllowedTypes('external_reference_id', ['string']); + $optionsResolver->addAllowedTypes('is_billed', ['bool']); $optionsResolver->setNormalizer('is_billed', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('is_running', ['bool']); + $optionsResolver->addAllowedTypes('is_running', ['bool']); $optionsResolver->setNormalizer('is_running', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -94,8 +94,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TimeEntries|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntries', 'json'); } diff --git a/generated/Endpoint/ListUserAssignments.php b/generated/Endpoint/ListUserAssignments.php index cb5dc92..79b6138 100644 --- a/generated/Endpoint/ListUserAssignments.php +++ b/generated/Endpoint/ListUserAssignments.php @@ -24,8 +24,9 @@ class ListUserAssignments extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpo * @var int $user_id only return user assignments belonging to the user with the given ID * @var bool $is_active pass true to only return active user assignments and false to return inactive user assignments * @var string $updated_since only return user assignments that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -61,15 +62,16 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['user_id', 'is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['user_id', 'is_active', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('user_id', ['int']); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('user_id', ['int']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -79,8 +81,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignments', 'json'); } diff --git a/generated/Endpoint/ListUserAssignmentsForSpecificProject.php b/generated/Endpoint/ListUserAssignmentsForSpecificProject.php index fe5cba1..17415f2 100644 --- a/generated/Endpoint/ListUserAssignmentsForSpecificProject.php +++ b/generated/Endpoint/ListUserAssignmentsForSpecificProject.php @@ -26,7 +26,7 @@ class ListUserAssignmentsForSpecificProject extends \JoliCode\Harvest\Api\Runtim * @var bool $is_active pass true to only return active user assignments and false to return inactive user assignments * @var string $updated_since only return user assignments that have been updated since the given date and time * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(string $projectId, array $queryParameters = []) @@ -66,12 +66,12 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['user_id', 'is_active', 'updated_since', 'page', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('user_id', ['int']); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('user_id', ['int']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -81,8 +81,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignments', 'json'); } diff --git a/generated/Endpoint/ListUsers.php b/generated/Endpoint/ListUsers.php index 788c432..b748f3b 100644 --- a/generated/Endpoint/ListUsers.php +++ b/generated/Endpoint/ListUsers.php @@ -23,8 +23,9 @@ class ListUsers extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implem * * @var bool $is_active pass true to only return active users and false to return inactive users * @var string $updated_since only return users that have been updated since the given date and time - * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 100) + * @var int $page DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) + * @var string $cursor Pagination cursor + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,14 +61,15 @@ public function getAuthenticationScopes(): array protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'cursor', 'per_page']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('updated_since', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('updated_since', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('cursor', ['string']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -77,8 +79,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\Users|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Users', 'json'); } diff --git a/generated/Endpoint/ProjectBudgetReport.php b/generated/Endpoint/ProjectBudgetReport.php index f24e4ea..d3dabcd 100644 --- a/generated/Endpoint/ProjectBudgetReport.php +++ b/generated/Endpoint/ProjectBudgetReport.php @@ -21,7 +21,7 @@ class ProjectBudgetReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpo * @param array $queryParameters { * * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * @var bool $is_active Pass true to only return active projects and false to return inactive projects. * } */ @@ -61,9 +61,9 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['page', 'per_page', 'is_active']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); - $optionsResolver->setAllowedTypes('is_active', ['bool']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('is_active', ['bool']); $optionsResolver->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); return $optionsResolver; @@ -74,8 +74,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ProjectBudgetReportResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults', 'json'); } diff --git a/generated/Endpoint/ProjectsExpensesReport.php b/generated/Endpoint/ProjectsExpensesReport.php index 6ec9cf9..e8dfb47 100644 --- a/generated/Endpoint/ProjectsExpensesReport.php +++ b/generated/Endpoint/ProjectsExpensesReport.php @@ -21,7 +21,7 @@ class ProjectsExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEn * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } diff --git a/generated/Endpoint/ProjectsTimeReport.php b/generated/Endpoint/ProjectsTimeReport.php index 5945094..b829705 100644 --- a/generated/Endpoint/ProjectsTimeReport.php +++ b/generated/Endpoint/ProjectsTimeReport.php @@ -21,7 +21,7 @@ class ProjectsTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoi * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } diff --git a/generated/Endpoint/RestartStoppedTimeEntry.php b/generated/Endpoint/RestartStoppedTimeEntry.php index 177d9d2..d86eab8 100644 --- a/generated/Endpoint/RestartStoppedTimeEntry.php +++ b/generated/Endpoint/RestartStoppedTimeEntry.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } diff --git a/generated/Endpoint/RetrieveBillableRate.php b/generated/Endpoint/RetrieveBillableRate.php index 917a392..a726e89 100644 --- a/generated/Endpoint/RetrieveBillableRate.php +++ b/generated/Endpoint/RetrieveBillableRate.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json'); } diff --git a/generated/Endpoint/RetrieveClient.php b/generated/Endpoint/RetrieveClient.php index c53e604..dc29247 100644 --- a/generated/Endpoint/RetrieveClient.php +++ b/generated/Endpoint/RetrieveClient.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json'); } diff --git a/generated/Endpoint/RetrieveCompany.php b/generated/Endpoint/RetrieveCompany.php index 1c02103..0109f4e 100644 --- a/generated/Endpoint/RetrieveCompany.php +++ b/generated/Endpoint/RetrieveCompany.php @@ -45,8 +45,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Company', 'json'); } diff --git a/generated/Endpoint/RetrieveContact.php b/generated/Endpoint/RetrieveContact.php index b295687..7335e82 100644 --- a/generated/Endpoint/RetrieveContact.php +++ b/generated/Endpoint/RetrieveContact.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json'); } diff --git a/generated/Endpoint/RetrieveCostRate.php b/generated/Endpoint/RetrieveCostRate.php index 15c6a24..87374d6 100644 --- a/generated/Endpoint/RetrieveCostRate.php +++ b/generated/Endpoint/RetrieveCostRate.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json'); } diff --git a/generated/Endpoint/RetrieveEstimate.php b/generated/Endpoint/RetrieveEstimate.php index 0f96e64..75b64f0 100644 --- a/generated/Endpoint/RetrieveEstimate.php +++ b/generated/Endpoint/RetrieveEstimate.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json'); } diff --git a/generated/Endpoint/RetrieveEstimateItemCategory.php b/generated/Endpoint/RetrieveEstimateItemCategory.php index 8dd757a..8b56d57 100644 --- a/generated/Endpoint/RetrieveEstimateItemCategory.php +++ b/generated/Endpoint/RetrieveEstimateItemCategory.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json'); } diff --git a/generated/Endpoint/RetrieveExpense.php b/generated/Endpoint/RetrieveExpense.php index cea52b2..238cc14 100644 --- a/generated/Endpoint/RetrieveExpense.php +++ b/generated/Endpoint/RetrieveExpense.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json'); } diff --git a/generated/Endpoint/RetrieveExpenseCategory.php b/generated/Endpoint/RetrieveExpenseCategory.php index 12ddb2a..0f54525 100644 --- a/generated/Endpoint/RetrieveExpenseCategory.php +++ b/generated/Endpoint/RetrieveExpenseCategory.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json'); } diff --git a/generated/Endpoint/RetrieveInvoice.php b/generated/Endpoint/RetrieveInvoice.php index 3b4bc6c..21e6e2d 100644 --- a/generated/Endpoint/RetrieveInvoice.php +++ b/generated/Endpoint/RetrieveInvoice.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json'); } diff --git a/generated/Endpoint/RetrieveInvoiceItemCategory.php b/generated/Endpoint/RetrieveInvoiceItemCategory.php index 2ce2e3d..c6ae54b 100644 --- a/generated/Endpoint/RetrieveInvoiceItemCategory.php +++ b/generated/Endpoint/RetrieveInvoiceItemCategory.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json'); } diff --git a/generated/Endpoint/RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoice.php b/generated/Endpoint/RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoice.php index afed386..8cfcad9 100644 --- a/generated/Endpoint/RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoice.php +++ b/generated/Endpoint/RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoice.php @@ -62,9 +62,9 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['thank_you', 'reminder']); $optionsResolver->setRequired([]); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('thank_you', ['bool']); + $optionsResolver->addAllowedTypes('thank_you', ['bool']); $optionsResolver->setNormalizer('thank_you', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); - $optionsResolver->setAllowedTypes('reminder', ['bool']); + $optionsResolver->addAllowedTypes('reminder', ['bool']); $optionsResolver->setNormalizer('reminder', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); return $optionsResolver; @@ -75,8 +75,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\InvoiceMessageSubjectAndBody|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageSubjectAndBody', 'json'); } diff --git a/generated/Endpoint/RetrieveProject.php b/generated/Endpoint/RetrieveProject.php index c99fd80..9fdec12 100644 --- a/generated/Endpoint/RetrieveProject.php +++ b/generated/Endpoint/RetrieveProject.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json'); } diff --git a/generated/Endpoint/RetrieveRole.php b/generated/Endpoint/RetrieveRole.php index 0565fbd..943b379 100644 --- a/generated/Endpoint/RetrieveRole.php +++ b/generated/Endpoint/RetrieveRole.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json'); } diff --git a/generated/Endpoint/RetrieveTask.php b/generated/Endpoint/RetrieveTask.php index 21c14c6..c28a24d 100644 --- a/generated/Endpoint/RetrieveTask.php +++ b/generated/Endpoint/RetrieveTask.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json'); } diff --git a/generated/Endpoint/RetrieveTaskAssignment.php b/generated/Endpoint/RetrieveTaskAssignment.php index 7245d24..9248b41 100644 --- a/generated/Endpoint/RetrieveTaskAssignment.php +++ b/generated/Endpoint/RetrieveTaskAssignment.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json'); } diff --git a/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php b/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php index e98d6c9..4be530d 100644 --- a/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php +++ b/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php @@ -45,8 +45,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } diff --git a/generated/Endpoint/RetrieveTimeEntry.php b/generated/Endpoint/RetrieveTimeEntry.php index 6f6a547..fca7d89 100644 --- a/generated/Endpoint/RetrieveTimeEntry.php +++ b/generated/Endpoint/RetrieveTimeEntry.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } diff --git a/generated/Endpoint/RetrieveUser.php b/generated/Endpoint/RetrieveUser.php index e890ec1..d5316c6 100644 --- a/generated/Endpoint/RetrieveUser.php +++ b/generated/Endpoint/RetrieveUser.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } diff --git a/generated/Endpoint/RetrieveUserAssignment.php b/generated/Endpoint/RetrieveUserAssignment.php index 8bf72ae..f0bf8c4 100644 --- a/generated/Endpoint/RetrieveUserAssignment.php +++ b/generated/Endpoint/RetrieveUserAssignment.php @@ -56,8 +56,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json'); } diff --git a/generated/Endpoint/StopRunningTimeEntry.php b/generated/Endpoint/StopRunningTimeEntry.php index 6ba10a4..7620318 100644 --- a/generated/Endpoint/StopRunningTimeEntry.php +++ b/generated/Endpoint/StopRunningTimeEntry.php @@ -54,8 +54,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } diff --git a/generated/Endpoint/TasksReport.php b/generated/Endpoint/TasksReport.php index 2b65219..21f63dc 100644 --- a/generated/Endpoint/TasksReport.php +++ b/generated/Endpoint/TasksReport.php @@ -21,7 +21,7 @@ class TasksReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint impl * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } diff --git a/generated/Endpoint/TeamExpensesReport.php b/generated/Endpoint/TeamExpensesReport.php index 340f4a9..c46c7a7 100644 --- a/generated/Endpoint/TeamExpensesReport.php +++ b/generated/Endpoint/TeamExpensesReport.php @@ -21,7 +21,7 @@ class TeamExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoi * @var string $from only report on expenses with a spent_date on or after the given date * @var string $to only report on expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } diff --git a/generated/Endpoint/TeamTimeReport.php b/generated/Endpoint/TeamTimeReport.php index 43b252c..48194da 100644 --- a/generated/Endpoint/TeamTimeReport.php +++ b/generated/Endpoint/TeamTimeReport.php @@ -21,7 +21,7 @@ class TeamTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint i * @var string $from only report on time entries with a spent_date on or after the given date * @var string $to only report on time entries with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -60,10 +60,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -73,8 +73,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } diff --git a/generated/Endpoint/UninvoicedReport.php b/generated/Endpoint/UninvoicedReport.php index 89a6ee3..c02a382 100644 --- a/generated/Endpoint/UninvoicedReport.php +++ b/generated/Endpoint/UninvoicedReport.php @@ -24,7 +24,7 @@ class UninvoicedReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint * @var string $from only report on time entries and expenses with a spent_date on or after the given date * @var string $to only report on time entries and expenses with a spent_date on or before the given date * @var int $page The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) - * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 1000) + * @var int $per_page The number of records to return per page. Can range between 1 and 2000. (Default: 2000) * } */ public function __construct(array $queryParameters = []) @@ -63,10 +63,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver $optionsResolver->setDefined(['from', 'to', 'page', 'per_page']); $optionsResolver->setRequired(['from', 'to']); $optionsResolver->setDefaults([]); - $optionsResolver->setAllowedTypes('from', ['string']); - $optionsResolver->setAllowedTypes('to', ['string']); - $optionsResolver->setAllowedTypes('page', ['int']); - $optionsResolver->setAllowedTypes('per_page', ['int']); + $optionsResolver->addAllowedTypes('from', ['string']); + $optionsResolver->addAllowedTypes('to', ['string']); + $optionsResolver->addAllowedTypes('page', ['int']); + $optionsResolver->addAllowedTypes('per_page', ['int']); return $optionsResolver; } @@ -76,8 +76,10 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver * * @return \JoliCode\Harvest\Api\Model\UninvoicedReportResults|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults', 'json'); } diff --git a/generated/Endpoint/UpdateClient.php b/generated/Endpoint/UpdateClient.php index ab41ab6..f961a05 100644 --- a/generated/Endpoint/UpdateClient.php +++ b/generated/Endpoint/UpdateClient.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json'); } diff --git a/generated/Endpoint/UpdateCompany.php b/generated/Endpoint/UpdateCompany.php index 346b816..12f9764 100644 --- a/generated/Endpoint/UpdateCompany.php +++ b/generated/Endpoint/UpdateCompany.php @@ -57,8 +57,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Company', 'json'); } diff --git a/generated/Endpoint/UpdateContact.php b/generated/Endpoint/UpdateContact.php index bec7e2f..9363b91 100644 --- a/generated/Endpoint/UpdateContact.php +++ b/generated/Endpoint/UpdateContact.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json'); } diff --git a/generated/Endpoint/UpdateEstimate.php b/generated/Endpoint/UpdateEstimate.php index f604960..deb4d7e 100644 --- a/generated/Endpoint/UpdateEstimate.php +++ b/generated/Endpoint/UpdateEstimate.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json'); } diff --git a/generated/Endpoint/UpdateEstimateItemCategory.php b/generated/Endpoint/UpdateEstimateItemCategory.php index 511b2a3..a288ff1 100644 --- a/generated/Endpoint/UpdateEstimateItemCategory.php +++ b/generated/Endpoint/UpdateEstimateItemCategory.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json'); } diff --git a/generated/Endpoint/UpdateExpense.php b/generated/Endpoint/UpdateExpense.php index f7a9aaa..8a32571 100644 --- a/generated/Endpoint/UpdateExpense.php +++ b/generated/Endpoint/UpdateExpense.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json'); } diff --git a/generated/Endpoint/UpdateExpenseCategory.php b/generated/Endpoint/UpdateExpenseCategory.php index 5b4f3af..e373185 100644 --- a/generated/Endpoint/UpdateExpenseCategory.php +++ b/generated/Endpoint/UpdateExpenseCategory.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json'); } diff --git a/generated/Endpoint/UpdateInvoice.php b/generated/Endpoint/UpdateInvoice.php index f47ae7b..e391abb 100644 --- a/generated/Endpoint/UpdateInvoice.php +++ b/generated/Endpoint/UpdateInvoice.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json'); } diff --git a/generated/Endpoint/UpdateInvoiceItemCategory.php b/generated/Endpoint/UpdateInvoiceItemCategory.php index 86ff46d..2525cba 100644 --- a/generated/Endpoint/UpdateInvoiceItemCategory.php +++ b/generated/Endpoint/UpdateInvoiceItemCategory.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json'); } diff --git a/generated/Endpoint/UpdateProject.php b/generated/Endpoint/UpdateProject.php index 07d318e..76c30d3 100644 --- a/generated/Endpoint/UpdateProject.php +++ b/generated/Endpoint/UpdateProject.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json'); } diff --git a/generated/Endpoint/UpdateRole.php b/generated/Endpoint/UpdateRole.php index 9416034..1f1a9c2 100644 --- a/generated/Endpoint/UpdateRole.php +++ b/generated/Endpoint/UpdateRole.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json'); } diff --git a/generated/Endpoint/UpdateTask.php b/generated/Endpoint/UpdateTask.php index 4afb4a1..49aabac 100644 --- a/generated/Endpoint/UpdateTask.php +++ b/generated/Endpoint/UpdateTask.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json'); } diff --git a/generated/Endpoint/UpdateTaskAssignment.php b/generated/Endpoint/UpdateTaskAssignment.php index 760a03b..419e22a 100644 --- a/generated/Endpoint/UpdateTaskAssignment.php +++ b/generated/Endpoint/UpdateTaskAssignment.php @@ -61,8 +61,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json'); } diff --git a/generated/Endpoint/UpdateTimeEntry.php b/generated/Endpoint/UpdateTimeEntry.php index 9139930..a4800a2 100644 --- a/generated/Endpoint/UpdateTimeEntry.php +++ b/generated/Endpoint/UpdateTimeEntry.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } diff --git a/generated/Endpoint/UpdateUser.php b/generated/Endpoint/UpdateUser.php index 2983471..14a25de 100644 --- a/generated/Endpoint/UpdateUser.php +++ b/generated/Endpoint/UpdateUser.php @@ -59,8 +59,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } diff --git a/generated/Endpoint/UpdateUserAssignedTeammates.php b/generated/Endpoint/UpdateUserAssignedTeammates.php index ddf7019..89de0c6 100644 --- a/generated/Endpoint/UpdateUserAssignedTeammates.php +++ b/generated/Endpoint/UpdateUserAssignedTeammates.php @@ -61,8 +61,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\TeammatesPatchResponse|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TeammatesPatchResponse', 'json'); } diff --git a/generated/Endpoint/UpdateUserAssignment.php b/generated/Endpoint/UpdateUserAssignment.php index 5f009de..a819409 100644 --- a/generated/Endpoint/UpdateUserAssignment.php +++ b/generated/Endpoint/UpdateUserAssignment.php @@ -61,8 +61,10 @@ public function getAuthenticationScopes(): array * * @return \JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|null */ - protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) + protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { + $status = $response->getStatusCode(); + $body = (string) $response->getBody(); if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json'); } diff --git a/generated/Model/BillableRate.php b/generated/Model/BillableRate.php index bffbd12..ab58645 100644 --- a/generated/Model/BillableRate.php +++ b/generated/Model/BillableRate.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class BillableRate +class BillableRate extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the billable rate. * @@ -50,6 +54,11 @@ class BillableRate */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the billable rate. */ @@ -63,6 +72,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -81,6 +91,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -99,6 +110,7 @@ public function getStartDate(): ?\DateTime */ public function setStartDate(?\DateTime $startDate): self { + $this->initialized['startDate'] = true; $this->startDate = $startDate; return $this; @@ -117,6 +129,7 @@ public function getEndDate(): ?\DateTime */ public function setEndDate(?\DateTime $endDate): self { + $this->initialized['endDate'] = true; $this->endDate = $endDate; return $this; @@ -135,6 +148,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -153,6 +167,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/BillableRates.php b/generated/Model/BillableRates.php index d56d200..f3d6ae7 100644 --- a/generated/Model/BillableRates.php +++ b/generated/Model/BillableRates.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class BillableRates +class BillableRates extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var BillableRate[] */ @@ -46,6 +50,11 @@ class BillableRates */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return BillableRate[] */ @@ -59,6 +68,7 @@ public function getBillableRates(): array */ public function setBillableRates(array $billableRates): self { + $this->initialized['billableRates'] = true; $this->billableRates = $billableRates; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/Client.php b/generated/Model/Client.php index 8a082aa..0c1e5fa 100644 --- a/generated/Model/Client.php +++ b/generated/Model/Client.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Client +class Client extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the client. * @@ -62,6 +66,11 @@ class Client */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the client. */ @@ -75,6 +84,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -93,6 +103,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -111,6 +122,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -129,6 +141,7 @@ public function getAddress(): ?string */ public function setAddress(?string $address): self { + $this->initialized['address'] = true; $this->address = $address; return $this; @@ -147,6 +160,7 @@ public function getStatementKey(): ?string */ public function setStatementKey(?string $statementKey): self { + $this->initialized['statementKey'] = true; $this->statementKey = $statementKey; return $this; @@ -165,6 +179,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -183,6 +198,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -201,6 +217,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/Clients.php b/generated/Model/Clients.php index d305d9d..ff1e116 100644 --- a/generated/Model/Clients.php +++ b/generated/Model/Clients.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Clients +class Clients extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Client[] */ @@ -46,6 +50,11 @@ class Clients */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Client[] */ @@ -59,6 +68,7 @@ public function getClients(): array */ public function setClients(array $clients): self { + $this->initialized['clients'] = true; $this->clients = $clients; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ClientsClientIdPatchBody.php b/generated/Model/ClientsClientIdPatchBody.php index d0c994f..72baab2 100644 --- a/generated/Model/ClientsClientIdPatchBody.php +++ b/generated/Model/ClientsClientIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ClientsClientIdPatchBody +class ClientsClientIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * A textual description of the client. * @@ -38,6 +42,11 @@ class ClientsClientIdPatchBody */ protected $currency; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * A textual description of the client. */ @@ -51,6 +60,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -69,6 +79,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -87,6 +98,7 @@ public function getAddress(): ?string */ public function setAddress(?string $address): self { + $this->initialized['address'] = true; $this->address = $address; return $this; @@ -105,6 +117,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; diff --git a/generated/Model/ClientsPostBody.php b/generated/Model/ClientsPostBody.php index 2d2c778..c74d7cf 100644 --- a/generated/Model/ClientsPostBody.php +++ b/generated/Model/ClientsPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ClientsPostBody +class ClientsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * A textual description of the client. * @@ -38,6 +42,11 @@ class ClientsPostBody */ protected $currency; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * A textual description of the client. */ @@ -51,6 +60,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -69,6 +79,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -87,6 +98,7 @@ public function getAddress(): ?string */ public function setAddress(?string $address): self { + $this->initialized['address'] = true; $this->address = $address; return $this; @@ -105,6 +117,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; diff --git a/generated/Model/Companies.php b/generated/Model/Companies.php index 13c5559..bc1b6c8 100644 --- a/generated/Model/Companies.php +++ b/generated/Model/Companies.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Companies +class Companies extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Company[] */ @@ -46,6 +50,11 @@ class Companies */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Company[] */ @@ -59,6 +68,7 @@ public function getCompanies(): array */ public function setCompanies(array $companies): self { + $this->initialized['companies'] = true; $this->companies = $companies; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/Company.php b/generated/Model/Company.php index da034cb..3f145de 100644 --- a/generated/Model/Company.php +++ b/generated/Model/Company.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Company +class Company extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The Harvest URL for the company. * @@ -134,6 +138,11 @@ class Company */ protected $approvalFeature; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The Harvest URL for the company. */ @@ -147,6 +156,7 @@ public function getBaseUri(): ?string */ public function setBaseUri(?string $baseUri): self { + $this->initialized['baseUri'] = true; $this->baseUri = $baseUri; return $this; @@ -165,6 +175,7 @@ public function getFullDomain(): ?string */ public function setFullDomain(?string $fullDomain): self { + $this->initialized['fullDomain'] = true; $this->fullDomain = $fullDomain; return $this; @@ -183,6 +194,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -201,6 +213,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -219,6 +232,7 @@ public function getWeekStartDay(): ?string */ public function setWeekStartDay(?string $weekStartDay): self { + $this->initialized['weekStartDay'] = true; $this->weekStartDay = $weekStartDay; return $this; @@ -237,6 +251,7 @@ public function getWantsTimestampTimers(): ?bool */ public function setWantsTimestampTimers(?bool $wantsTimestampTimers): self { + $this->initialized['wantsTimestampTimers'] = true; $this->wantsTimestampTimers = $wantsTimestampTimers; return $this; @@ -255,6 +270,7 @@ public function getTimeFormat(): ?string */ public function setTimeFormat(?string $timeFormat): self { + $this->initialized['timeFormat'] = true; $this->timeFormat = $timeFormat; return $this; @@ -273,6 +289,7 @@ public function getDateFormat(): ?string */ public function setDateFormat(?string $dateFormat): self { + $this->initialized['dateFormat'] = true; $this->dateFormat = $dateFormat; return $this; @@ -291,6 +308,7 @@ public function getPlanType(): ?string */ public function setPlanType(?string $planType): self { + $this->initialized['planType'] = true; $this->planType = $planType; return $this; @@ -309,6 +327,7 @@ public function getClock(): ?string */ public function setClock(?string $clock): self { + $this->initialized['clock'] = true; $this->clock = $clock; return $this; @@ -327,6 +346,7 @@ public function getCurrencyCodeDisplay(): ?string */ public function setCurrencyCodeDisplay(?string $currencyCodeDisplay): self { + $this->initialized['currencyCodeDisplay'] = true; $this->currencyCodeDisplay = $currencyCodeDisplay; return $this; @@ -345,6 +365,7 @@ public function getCurrencySymbolDisplay(): ?string */ public function setCurrencySymbolDisplay(?string $currencySymbolDisplay): self { + $this->initialized['currencySymbolDisplay'] = true; $this->currencySymbolDisplay = $currencySymbolDisplay; return $this; @@ -363,6 +384,7 @@ public function getDecimalSymbol(): ?string */ public function setDecimalSymbol(?string $decimalSymbol): self { + $this->initialized['decimalSymbol'] = true; $this->decimalSymbol = $decimalSymbol; return $this; @@ -381,6 +403,7 @@ public function getThousandsSeparator(): ?string */ public function setThousandsSeparator(?string $thousandsSeparator): self { + $this->initialized['thousandsSeparator'] = true; $this->thousandsSeparator = $thousandsSeparator; return $this; @@ -399,6 +422,7 @@ public function getColorScheme(): ?string */ public function setColorScheme(?string $colorScheme): self { + $this->initialized['colorScheme'] = true; $this->colorScheme = $colorScheme; return $this; @@ -417,6 +441,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; @@ -435,6 +460,7 @@ public function getExpenseFeature(): ?bool */ public function setExpenseFeature(?bool $expenseFeature): self { + $this->initialized['expenseFeature'] = true; $this->expenseFeature = $expenseFeature; return $this; @@ -453,6 +479,7 @@ public function getInvoiceFeature(): ?bool */ public function setInvoiceFeature(?bool $invoiceFeature): self { + $this->initialized['invoiceFeature'] = true; $this->invoiceFeature = $invoiceFeature; return $this; @@ -471,6 +498,7 @@ public function getEstimateFeature(): ?bool */ public function setEstimateFeature(?bool $estimateFeature): self { + $this->initialized['estimateFeature'] = true; $this->estimateFeature = $estimateFeature; return $this; @@ -489,6 +517,7 @@ public function getApprovalFeature(): ?bool */ public function setApprovalFeature(?bool $approvalFeature): self { + $this->initialized['approvalFeature'] = true; $this->approvalFeature = $approvalFeature; return $this; diff --git a/generated/Model/CompanyPatchBody.php b/generated/Model/CompanyPatchBody.php index 1665667..c3d57e9 100644 --- a/generated/Model/CompanyPatchBody.php +++ b/generated/Model/CompanyPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class CompanyPatchBody +class CompanyPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Whether time is tracked via duration or start and end times. * @@ -26,6 +30,11 @@ class CompanyPatchBody */ protected $weeklyCapacity; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Whether time is tracked via duration or start and end times. */ @@ -39,6 +48,7 @@ public function getWantsTimestampTimers(): ?bool */ public function setWantsTimestampTimers(?bool $wantsTimestampTimers): self { + $this->initialized['wantsTimestampTimers'] = true; $this->wantsTimestampTimers = $wantsTimestampTimers; return $this; @@ -57,6 +67,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; diff --git a/generated/Model/Contact.php b/generated/Model/Contact.php index 6628711..5b54dc4 100644 --- a/generated/Model/Contact.php +++ b/generated/Model/Contact.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Contact +class Contact extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the contact. * @@ -80,6 +84,11 @@ class Contact */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the contact. */ @@ -93,6 +102,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -111,6 +121,7 @@ public function getClient(): ?ContactClient */ public function setClient(?ContactClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -129,6 +140,7 @@ public function getTitle(): ?string */ public function setTitle(?string $title): self { + $this->initialized['title'] = true; $this->title = $title; return $this; @@ -147,6 +159,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -165,6 +178,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -183,6 +197,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -201,6 +216,7 @@ public function getPhoneOffice(): ?string */ public function setPhoneOffice(?string $phoneOffice): self { + $this->initialized['phoneOffice'] = true; $this->phoneOffice = $phoneOffice; return $this; @@ -219,6 +235,7 @@ public function getPhoneMobile(): ?string */ public function setPhoneMobile(?string $phoneMobile): self { + $this->initialized['phoneMobile'] = true; $this->phoneMobile = $phoneMobile; return $this; @@ -237,6 +254,7 @@ public function getFax(): ?string */ public function setFax(?string $fax): self { + $this->initialized['fax'] = true; $this->fax = $fax; return $this; @@ -255,6 +273,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -273,6 +292,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/ContactClient.php b/generated/Model/ContactClient.php index 5c5ad1b..7a584f9 100644 --- a/generated/Model/ContactClient.php +++ b/generated/Model/ContactClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ContactClient +class ContactClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class ContactClient */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/Contacts.php b/generated/Model/Contacts.php index e5d8e31..75ea776 100644 --- a/generated/Model/Contacts.php +++ b/generated/Model/Contacts.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Contacts +class Contacts extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Contact[] */ @@ -46,6 +50,11 @@ class Contacts */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Contact[] */ @@ -59,6 +68,7 @@ public function getContacts(): array */ public function setContacts(array $contacts): self { + $this->initialized['contacts'] = true; $this->contacts = $contacts; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ContactsContactIdPatchBody.php b/generated/Model/ContactsContactIdPatchBody.php index 1b4426d..8f1ae3c 100644 --- a/generated/Model/ContactsContactIdPatchBody.php +++ b/generated/Model/ContactsContactIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ContactsContactIdPatchBody +class ContactsContactIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client associated with this contact. * @@ -62,6 +66,11 @@ class ContactsContactIdPatchBody */ protected $fax; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client associated with this contact. */ @@ -75,6 +84,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -93,6 +103,7 @@ public function getTitle(): ?string */ public function setTitle(?string $title): self { + $this->initialized['title'] = true; $this->title = $title; return $this; @@ -111,6 +122,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -129,6 +141,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -147,6 +160,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -165,6 +179,7 @@ public function getPhoneOffice(): ?string */ public function setPhoneOffice(?string $phoneOffice): self { + $this->initialized['phoneOffice'] = true; $this->phoneOffice = $phoneOffice; return $this; @@ -183,6 +198,7 @@ public function getPhoneMobile(): ?string */ public function setPhoneMobile(?string $phoneMobile): self { + $this->initialized['phoneMobile'] = true; $this->phoneMobile = $phoneMobile; return $this; @@ -201,6 +217,7 @@ public function getFax(): ?string */ public function setFax(?string $fax): self { + $this->initialized['fax'] = true; $this->fax = $fax; return $this; diff --git a/generated/Model/ContactsPostBody.php b/generated/Model/ContactsPostBody.php index 64051d6..feb03d7 100644 --- a/generated/Model/ContactsPostBody.php +++ b/generated/Model/ContactsPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ContactsPostBody +class ContactsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client associated with this contact. * @@ -62,6 +66,11 @@ class ContactsPostBody */ protected $fax; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client associated with this contact. */ @@ -75,6 +84,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -93,6 +103,7 @@ public function getTitle(): ?string */ public function setTitle(?string $title): self { + $this->initialized['title'] = true; $this->title = $title; return $this; @@ -111,6 +122,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -129,6 +141,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -147,6 +160,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -165,6 +179,7 @@ public function getPhoneOffice(): ?string */ public function setPhoneOffice(?string $phoneOffice): self { + $this->initialized['phoneOffice'] = true; $this->phoneOffice = $phoneOffice; return $this; @@ -183,6 +198,7 @@ public function getPhoneMobile(): ?string */ public function setPhoneMobile(?string $phoneMobile): self { + $this->initialized['phoneMobile'] = true; $this->phoneMobile = $phoneMobile; return $this; @@ -201,6 +217,7 @@ public function getFax(): ?string */ public function setFax(?string $fax): self { + $this->initialized['fax'] = true; $this->fax = $fax; return $this; diff --git a/generated/Model/CostRate.php b/generated/Model/CostRate.php index 56ed7ba..61d758e 100644 --- a/generated/Model/CostRate.php +++ b/generated/Model/CostRate.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class CostRate +class CostRate extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the cost rate. * @@ -50,6 +54,11 @@ class CostRate */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the cost rate. */ @@ -63,6 +72,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -81,6 +91,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -99,6 +110,7 @@ public function getStartDate(): ?\DateTime */ public function setStartDate(?\DateTime $startDate): self { + $this->initialized['startDate'] = true; $this->startDate = $startDate; return $this; @@ -117,6 +129,7 @@ public function getEndDate(): ?\DateTime */ public function setEndDate(?\DateTime $endDate): self { + $this->initialized['endDate'] = true; $this->endDate = $endDate; return $this; @@ -135,6 +148,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -153,6 +167,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/CostRates.php b/generated/Model/CostRates.php index 2e2eb16..f20cfb8 100644 --- a/generated/Model/CostRates.php +++ b/generated/Model/CostRates.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class CostRates +class CostRates extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var CostRate[] */ @@ -46,6 +50,11 @@ class CostRates */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return CostRate[] */ @@ -59,6 +68,7 @@ public function getCostRates(): array */ public function setCostRates(array $costRates): self { + $this->initialized['costRates'] = true; $this->costRates = $costRates; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/Error.php b/generated/Model/Error.php index d056d18..d58c1c6 100644 --- a/generated/Model/Error.php +++ b/generated/Model/Error.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Error +class Error extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int */ @@ -22,6 +26,11 @@ class Error */ protected $message; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getCode(): int { return $this->code; @@ -29,6 +38,7 @@ public function getCode(): int public function setCode(int $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; @@ -41,6 +51,7 @@ public function getMessage(): string public function setMessage(string $message): self { + $this->initialized['message'] = true; $this->message = $message; return $this; diff --git a/generated/Model/Estimate.php b/generated/Model/Estimate.php index 630da14..4411627 100644 --- a/generated/Model/Estimate.php +++ b/generated/Model/Estimate.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Estimate +class Estimate extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the estimate. * @@ -92,7 +96,7 @@ class Estimate */ protected $discount; /** - * The amount calcuated from discount. + * The amount calculated from discount. * * @var float|null */ @@ -158,6 +162,11 @@ class Estimate */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the estimate. */ @@ -171,6 +180,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -189,6 +199,7 @@ public function getClient(): ?EstimateClient */ public function setClient(?EstimateClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -211,6 +222,7 @@ public function getLineItems(): ?array */ public function setLineItems(?array $lineItems): self { + $this->initialized['lineItems'] = true; $this->lineItems = $lineItems; return $this; @@ -229,6 +241,7 @@ public function getCreator(): ?EstimateCreator */ public function setCreator(?EstimateCreator $creator): self { + $this->initialized['creator'] = true; $this->creator = $creator; return $this; @@ -247,6 +260,7 @@ public function getClientKey(): ?string */ public function setClientKey(?string $clientKey): self { + $this->initialized['clientKey'] = true; $this->clientKey = $clientKey; return $this; @@ -265,6 +279,7 @@ public function getNumber(): ?string */ public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; @@ -283,6 +298,7 @@ public function getPurchaseOrder(): ?string */ public function setPurchaseOrder(?string $purchaseOrder): self { + $this->initialized['purchaseOrder'] = true; $this->purchaseOrder = $purchaseOrder; return $this; @@ -301,6 +317,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -319,6 +336,7 @@ public function getTax(): ?float */ public function setTax(?float $tax): self { + $this->initialized['tax'] = true; $this->tax = $tax; return $this; @@ -337,6 +355,7 @@ public function getTaxAmount(): ?float */ public function setTaxAmount(?float $taxAmount): self { + $this->initialized['taxAmount'] = true; $this->taxAmount = $taxAmount; return $this; @@ -355,6 +374,7 @@ public function getTax2(): ?float */ public function setTax2(?float $tax2): self { + $this->initialized['tax2'] = true; $this->tax2 = $tax2; return $this; @@ -373,6 +393,7 @@ public function getTax2Amount(): ?float */ public function setTax2Amount(?float $tax2Amount): self { + $this->initialized['tax2Amount'] = true; $this->tax2Amount = $tax2Amount; return $this; @@ -391,13 +412,14 @@ public function getDiscount(): ?float */ public function setDiscount(?float $discount): self { + $this->initialized['discount'] = true; $this->discount = $discount; return $this; } /** - * The amount calcuated from discount. + * The amount calculated from discount. */ public function getDiscountAmount(): ?float { @@ -405,10 +427,11 @@ public function getDiscountAmount(): ?float } /** - * The amount calcuated from discount. + * The amount calculated from discount. */ public function setDiscountAmount(?float $discountAmount): self { + $this->initialized['discountAmount'] = true; $this->discountAmount = $discountAmount; return $this; @@ -427,6 +450,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -445,6 +469,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -463,6 +488,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -481,6 +507,7 @@ public function getState(): ?string */ public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; @@ -499,6 +526,7 @@ public function getIssueDate(): ?\DateTime */ public function setIssueDate(?\DateTime $issueDate): self { + $this->initialized['issueDate'] = true; $this->issueDate = $issueDate; return $this; @@ -517,6 +545,7 @@ public function getSentAt(): ?\DateTime */ public function setSentAt(?\DateTime $sentAt): self { + $this->initialized['sentAt'] = true; $this->sentAt = $sentAt; return $this; @@ -535,6 +564,7 @@ public function getAcceptedAt(): ?\DateTime */ public function setAcceptedAt(?\DateTime $acceptedAt): self { + $this->initialized['acceptedAt'] = true; $this->acceptedAt = $acceptedAt; return $this; @@ -553,6 +583,7 @@ public function getDeclinedAt(): ?\DateTime */ public function setDeclinedAt(?\DateTime $declinedAt): self { + $this->initialized['declinedAt'] = true; $this->declinedAt = $declinedAt; return $this; @@ -571,6 +602,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -589,6 +621,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/EstimateClient.php b/generated/Model/EstimateClient.php index 6426984..289b647 100644 --- a/generated/Model/EstimateClient.php +++ b/generated/Model/EstimateClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateClient +class EstimateClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class EstimateClient */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/EstimateCreator.php b/generated/Model/EstimateCreator.php index dca4bd0..4bb61c4 100644 --- a/generated/Model/EstimateCreator.php +++ b/generated/Model/EstimateCreator.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateCreator +class EstimateCreator extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class EstimateCreator */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/EstimateItemCategories.php b/generated/Model/EstimateItemCategories.php index 910624e..90455ab 100644 --- a/generated/Model/EstimateItemCategories.php +++ b/generated/Model/EstimateItemCategories.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateItemCategories +class EstimateItemCategories extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var EstimateItemCategory[] */ @@ -46,6 +50,11 @@ class EstimateItemCategories */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return EstimateItemCategory[] */ @@ -59,6 +68,7 @@ public function getEstimateItemCategories(): array */ public function setEstimateItemCategories(array $estimateItemCategories): self { + $this->initialized['estimateItemCategories'] = true; $this->estimateItemCategories = $estimateItemCategories; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php b/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php index e9288b0..59ecd70 100644 --- a/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php +++ b/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateItemCategoriesEstimateItemCategoryIdPatchBody +class EstimateItemCategoriesEstimateItemCategoryIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the estimate item category. * @@ -20,6 +24,11 @@ class EstimateItemCategoriesEstimateItemCategoryIdPatchBody */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the estimate item category. */ @@ -33,6 +42,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/EstimateItemCategoriesPostBody.php b/generated/Model/EstimateItemCategoriesPostBody.php index 18d156c..d2608ca 100644 --- a/generated/Model/EstimateItemCategoriesPostBody.php +++ b/generated/Model/EstimateItemCategoriesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateItemCategoriesPostBody +class EstimateItemCategoriesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the estimate item category. * @@ -20,6 +24,11 @@ class EstimateItemCategoriesPostBody */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the estimate item category. */ @@ -33,6 +42,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/EstimateItemCategory.php b/generated/Model/EstimateItemCategory.php index 69865ac..8600679 100644 --- a/generated/Model/EstimateItemCategory.php +++ b/generated/Model/EstimateItemCategory.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateItemCategory +class EstimateItemCategory extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the estimate item category. * @@ -38,6 +42,11 @@ class EstimateItemCategory */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the estimate item category. */ @@ -51,6 +60,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -69,6 +79,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -87,6 +98,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -105,6 +117,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/EstimateLineItem.php b/generated/Model/EstimateLineItem.php index 41990b8..3365c77 100644 --- a/generated/Model/EstimateLineItem.php +++ b/generated/Model/EstimateLineItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateLineItem +class EstimateLineItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the line item. * @@ -62,6 +66,11 @@ class EstimateLineItem */ protected $taxed2; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the line item. */ @@ -75,6 +84,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -93,6 +103,7 @@ public function getKind(): ?string */ public function setKind(?string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; @@ -111,6 +122,7 @@ public function getDescription(): ?string */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -129,6 +141,7 @@ public function getQuantity(): ?float */ public function setQuantity(?float $quantity): self { + $this->initialized['quantity'] = true; $this->quantity = $quantity; return $this; @@ -147,6 +160,7 @@ public function getUnitPrice(): ?float */ public function setUnitPrice(?float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -165,6 +179,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -183,6 +198,7 @@ public function getTaxed(): ?bool */ public function setTaxed(?bool $taxed): self { + $this->initialized['taxed'] = true; $this->taxed = $taxed; return $this; @@ -201,6 +217,7 @@ public function getTaxed2(): ?bool */ public function setTaxed2(?bool $taxed2): self { + $this->initialized['taxed2'] = true; $this->taxed2 = $taxed2; return $this; diff --git a/generated/Model/EstimateLineItems.php b/generated/Model/EstimateLineItems.php index de5cb56..87cf847 100644 --- a/generated/Model/EstimateLineItems.php +++ b/generated/Model/EstimateLineItems.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateLineItems +class EstimateLineItems extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var EstimateLineItem[] */ @@ -46,6 +50,11 @@ class EstimateLineItems */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return EstimateLineItem[] */ @@ -59,6 +68,7 @@ public function getEstimateLineItems(): array */ public function setEstimateLineItems(array $estimateLineItems): self { + $this->initialized['estimateLineItems'] = true; $this->estimateLineItems = $estimateLineItems; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/EstimateMessage.php b/generated/Model/EstimateMessage.php index 51607ee..47540a6 100644 --- a/generated/Model/EstimateMessage.php +++ b/generated/Model/EstimateMessage.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateMessage +class EstimateMessage extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the message. * @@ -86,6 +90,11 @@ class EstimateMessage */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the message. */ @@ -99,6 +108,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -117,6 +127,7 @@ public function getSentBy(): ?string */ public function setSentBy(?string $sentBy): self { + $this->initialized['sentBy'] = true; $this->sentBy = $sentBy; return $this; @@ -135,6 +146,7 @@ public function getSentByEmail(): ?string */ public function setSentByEmail(?string $sentByEmail): self { + $this->initialized['sentByEmail'] = true; $this->sentByEmail = $sentByEmail; return $this; @@ -153,6 +165,7 @@ public function getSentFrom(): ?string */ public function setSentFrom(?string $sentFrom): self { + $this->initialized['sentFrom'] = true; $this->sentFrom = $sentFrom; return $this; @@ -171,6 +184,7 @@ public function getSentFromEmail(): ?string */ public function setSentFromEmail(?string $sentFromEmail): self { + $this->initialized['sentFromEmail'] = true; $this->sentFromEmail = $sentFromEmail; return $this; @@ -193,6 +207,7 @@ public function getRecipients(): ?array */ public function setRecipients(?array $recipients): self { + $this->initialized['recipients'] = true; $this->recipients = $recipients; return $this; @@ -211,6 +226,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -229,6 +245,7 @@ public function getBody(): ?string */ public function setBody(?string $body): self { + $this->initialized['body'] = true; $this->body = $body; return $this; @@ -247,6 +264,7 @@ public function getSendMeACopy(): ?bool */ public function setSendMeACopy(?bool $sendMeACopy): self { + $this->initialized['sendMeACopy'] = true; $this->sendMeACopy = $sendMeACopy; return $this; @@ -265,6 +283,7 @@ public function getEventType(): ?string */ public function setEventType(?string $eventType): self { + $this->initialized['eventType'] = true; $this->eventType = $eventType; return $this; @@ -283,6 +302,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -301,6 +321,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/EstimateMessageRecipient.php b/generated/Model/EstimateMessageRecipient.php index aec372b..893ebf5 100644 --- a/generated/Model/EstimateMessageRecipient.php +++ b/generated/Model/EstimateMessageRecipient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateMessageRecipient +class EstimateMessageRecipient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Name of the message recipient. * @@ -26,6 +30,11 @@ class EstimateMessageRecipient */ protected $email; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Name of the message recipient. */ @@ -39,6 +48,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +67,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; diff --git a/generated/Model/EstimateMessageRecipients.php b/generated/Model/EstimateMessageRecipients.php index 9b71a06..d1883b5 100644 --- a/generated/Model/EstimateMessageRecipients.php +++ b/generated/Model/EstimateMessageRecipients.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateMessageRecipients +class EstimateMessageRecipients extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var EstimateMessageRecipient[] */ @@ -46,6 +50,11 @@ class EstimateMessageRecipients */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return EstimateMessageRecipient[] */ @@ -59,6 +68,7 @@ public function getEstimateMessageRecipients(): array */ public function setEstimateMessageRecipients(array $estimateMessageRecipients): self { + $this->initialized['estimateMessageRecipients'] = true; $this->estimateMessageRecipients = $estimateMessageRecipients; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/EstimateMessages.php b/generated/Model/EstimateMessages.php index 489bd16..ab5d6e6 100644 --- a/generated/Model/EstimateMessages.php +++ b/generated/Model/EstimateMessages.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimateMessages +class EstimateMessages extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var EstimateMessage[] */ @@ -46,6 +50,11 @@ class EstimateMessages */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return EstimateMessage[] */ @@ -59,6 +68,7 @@ public function getEstimateMessages(): array */ public function setEstimateMessages(array $estimateMessages): self { + $this->initialized['estimateMessages'] = true; $this->estimateMessages = $estimateMessages; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/Estimates.php b/generated/Model/Estimates.php index 28188d7..d716949 100644 --- a/generated/Model/Estimates.php +++ b/generated/Model/Estimates.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Estimates +class Estimates extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Estimate[] */ @@ -46,6 +50,11 @@ class Estimates */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Estimate[] */ @@ -59,6 +68,7 @@ public function getEstimates(): array */ public function setEstimates(array $estimates): self { + $this->initialized['estimates'] = true; $this->estimates = $estimates; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/EstimatesEstimateIdMessagesPostBody.php b/generated/Model/EstimatesEstimateIdMessagesPostBody.php index 14d178a..8a9df18 100644 --- a/generated/Model/EstimatesEstimateIdMessagesPostBody.php +++ b/generated/Model/EstimatesEstimateIdMessagesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimatesEstimateIdMessagesPostBody +class EstimatesEstimateIdMessagesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * If provided, runs an event against the estimate. Options: “accept”, “decline”, “re-open”, or “send”. * @@ -44,6 +48,11 @@ class EstimatesEstimateIdMessagesPostBody */ protected $sendMeACopy; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * If provided, runs an event against the estimate. Options: “accept”, “decline”, “re-open”, or “send”. */ @@ -57,6 +66,7 @@ public function getEventType(): ?string */ public function setEventType(?string $eventType): self { + $this->initialized['eventType'] = true; $this->eventType = $eventType; return $this; @@ -79,6 +89,7 @@ public function getRecipients(): ?array */ public function setRecipients(?array $recipients): self { + $this->initialized['recipients'] = true; $this->recipients = $recipients; return $this; @@ -97,6 +108,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -115,6 +127,7 @@ public function getBody(): ?string */ public function setBody(?string $body): self { + $this->initialized['body'] = true; $this->body = $body; return $this; @@ -133,6 +146,7 @@ public function getSendMeACopy(): ?bool */ public function setSendMeACopy(?bool $sendMeACopy): self { + $this->initialized['sendMeACopy'] = true; $this->sendMeACopy = $sendMeACopy; return $this; diff --git a/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php b/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php index 88a3039..bb1b24d 100644 --- a/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php +++ b/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimatesEstimateIdMessagesPostBodyRecipientsItem +class EstimatesEstimateIdMessagesPostBodyRecipientsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Name of the message recipient. * @@ -26,6 +30,11 @@ class EstimatesEstimateIdMessagesPostBodyRecipientsItem */ protected $email; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Name of the message recipient. */ @@ -39,6 +48,7 @@ public function getName(): string */ public function setName(string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +67,7 @@ public function getEmail(): string */ public function setEmail(string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; diff --git a/generated/Model/EstimatesEstimateIdPatchBody.php b/generated/Model/EstimatesEstimateIdPatchBody.php index 607bf41..081c960 100644 --- a/generated/Model/EstimatesEstimateIdPatchBody.php +++ b/generated/Model/EstimatesEstimateIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimatesEstimateIdPatchBody +class EstimatesEstimateIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client this estimate belongs to. * @@ -80,6 +84,11 @@ class EstimatesEstimateIdPatchBody */ protected $lineItems; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client this estimate belongs to. */ @@ -93,6 +102,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -111,6 +121,7 @@ public function getNumber(): ?string */ public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; @@ -129,6 +140,7 @@ public function getPurchaseOrder(): ?string */ public function setPurchaseOrder(?string $purchaseOrder): self { + $this->initialized['purchaseOrder'] = true; $this->purchaseOrder = $purchaseOrder; return $this; @@ -147,6 +159,7 @@ public function getTax(): ?float */ public function setTax(?float $tax): self { + $this->initialized['tax'] = true; $this->tax = $tax; return $this; @@ -165,6 +178,7 @@ public function getTax2(): ?float */ public function setTax2(?float $tax2): self { + $this->initialized['tax2'] = true; $this->tax2 = $tax2; return $this; @@ -183,6 +197,7 @@ public function getDiscount(): ?float */ public function setDiscount(?float $discount): self { + $this->initialized['discount'] = true; $this->discount = $discount; return $this; @@ -201,6 +216,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -219,6 +235,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -237,6 +254,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -255,6 +273,7 @@ public function getIssueDate(): ?\DateTime */ public function setIssueDate(?\DateTime $issueDate): self { + $this->initialized['issueDate'] = true; $this->issueDate = $issueDate; return $this; @@ -277,6 +296,7 @@ public function getLineItems(): ?array */ public function setLineItems(?array $lineItems): self { + $this->initialized['lineItems'] = true; $this->lineItems = $lineItems; return $this; diff --git a/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php b/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php index 6e728d3..3147361 100644 --- a/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php +++ b/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimatesEstimateIdPatchBodyLineItemsItem +class EstimatesEstimateIdPatchBodyLineItemsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the line item. * @@ -56,6 +60,11 @@ class EstimatesEstimateIdPatchBodyLineItemsItem */ protected $taxed2; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the line item. */ @@ -69,6 +78,7 @@ public function getId(): int */ public function setId(int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -87,6 +97,7 @@ public function getKind(): string */ public function setKind(string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; @@ -105,6 +116,7 @@ public function getDescription(): string */ public function setDescription(string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -123,6 +135,7 @@ public function getQuantity(): int */ public function setQuantity(int $quantity): self { + $this->initialized['quantity'] = true; $this->quantity = $quantity; return $this; @@ -141,6 +154,7 @@ public function getUnitPrice(): float */ public function setUnitPrice(float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -159,6 +173,7 @@ public function getTaxed(): bool */ public function setTaxed(bool $taxed): self { + $this->initialized['taxed'] = true; $this->taxed = $taxed; return $this; @@ -177,6 +192,7 @@ public function getTaxed2(): bool */ public function setTaxed2(bool $taxed2): self { + $this->initialized['taxed2'] = true; $this->taxed2 = $taxed2; return $this; diff --git a/generated/Model/EstimatesPostBody.php b/generated/Model/EstimatesPostBody.php index 685713d..81b688c 100644 --- a/generated/Model/EstimatesPostBody.php +++ b/generated/Model/EstimatesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimatesPostBody +class EstimatesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client this estimate belongs to. * @@ -80,6 +84,11 @@ class EstimatesPostBody */ protected $lineItems; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client this estimate belongs to. */ @@ -93,6 +102,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -111,6 +121,7 @@ public function getNumber(): ?string */ public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; @@ -129,6 +140,7 @@ public function getPurchaseOrder(): ?string */ public function setPurchaseOrder(?string $purchaseOrder): self { + $this->initialized['purchaseOrder'] = true; $this->purchaseOrder = $purchaseOrder; return $this; @@ -147,6 +159,7 @@ public function getTax(): ?float */ public function setTax(?float $tax): self { + $this->initialized['tax'] = true; $this->tax = $tax; return $this; @@ -165,6 +178,7 @@ public function getTax2(): ?float */ public function setTax2(?float $tax2): self { + $this->initialized['tax2'] = true; $this->tax2 = $tax2; return $this; @@ -183,6 +197,7 @@ public function getDiscount(): ?float */ public function setDiscount(?float $discount): self { + $this->initialized['discount'] = true; $this->discount = $discount; return $this; @@ -201,6 +216,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -219,6 +235,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -237,6 +254,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -255,6 +273,7 @@ public function getIssueDate(): ?\DateTime */ public function setIssueDate(?\DateTime $issueDate): self { + $this->initialized['issueDate'] = true; $this->issueDate = $issueDate; return $this; @@ -277,6 +296,7 @@ public function getLineItems(): ?array */ public function setLineItems(?array $lineItems): self { + $this->initialized['lineItems'] = true; $this->lineItems = $lineItems; return $this; diff --git a/generated/Model/EstimatesPostBodyLineItemsItem.php b/generated/Model/EstimatesPostBodyLineItemsItem.php index baa3407..47508d5 100644 --- a/generated/Model/EstimatesPostBodyLineItemsItem.php +++ b/generated/Model/EstimatesPostBodyLineItemsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class EstimatesPostBodyLineItemsItem +class EstimatesPostBodyLineItemsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of an estimate item category. * @@ -50,6 +54,11 @@ class EstimatesPostBodyLineItemsItem */ protected $taxed2; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of an estimate item category. */ @@ -63,6 +72,7 @@ public function getKind(): string */ public function setKind(string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; @@ -81,6 +91,7 @@ public function getDescription(): string */ public function setDescription(string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -99,6 +110,7 @@ public function getQuantity(): int */ public function setQuantity(int $quantity): self { + $this->initialized['quantity'] = true; $this->quantity = $quantity; return $this; @@ -117,6 +129,7 @@ public function getUnitPrice(): float */ public function setUnitPrice(float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -135,6 +148,7 @@ public function getTaxed(): bool */ public function setTaxed(bool $taxed): self { + $this->initialized['taxed'] = true; $this->taxed = $taxed; return $this; @@ -153,6 +167,7 @@ public function getTaxed2(): bool */ public function setTaxed2(bool $taxed2): self { + $this->initialized['taxed2'] = true; $this->taxed2 = $taxed2; return $this; diff --git a/generated/Model/Expense.php b/generated/Model/Expense.php index 72da933..0d0e0b7 100644 --- a/generated/Model/Expense.php +++ b/generated/Model/Expense.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Expense +class Expense extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the expense. * @@ -126,6 +130,11 @@ class Expense */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the expense. */ @@ -139,6 +148,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -157,6 +167,7 @@ public function getClient(): ?ExpenseClient */ public function setClient(?ExpenseClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -175,6 +186,7 @@ public function getProject(): ?ExpenseProject */ public function setProject(?ExpenseProject $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; @@ -193,6 +205,7 @@ public function getExpenseCategory(): ?ExpenseExpenseCategory */ public function setExpenseCategory(?ExpenseExpenseCategory $expenseCategory): self { + $this->initialized['expenseCategory'] = true; $this->expenseCategory = $expenseCategory; return $this; @@ -211,6 +224,7 @@ public function getUser(): ?ExpenseUser */ public function setUser(?ExpenseUser $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -223,6 +237,7 @@ public function getUserAssignment(): UserAssignment public function setUserAssignment(UserAssignment $userAssignment): self { + $this->initialized['userAssignment'] = true; $this->userAssignment = $userAssignment; return $this; @@ -241,6 +256,7 @@ public function getReceipt(): ?ExpenseReceipt */ public function setReceipt(?ExpenseReceipt $receipt): self { + $this->initialized['receipt'] = true; $this->receipt = $receipt; return $this; @@ -259,6 +275,7 @@ public function getInvoice(): ?ExpenseInvoice */ public function setInvoice(?ExpenseInvoice $invoice): self { + $this->initialized['invoice'] = true; $this->invoice = $invoice; return $this; @@ -277,6 +294,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -295,6 +313,7 @@ public function getUnits(): ?int */ public function setUnits(?int $units): self { + $this->initialized['units'] = true; $this->units = $units; return $this; @@ -313,6 +332,7 @@ public function getTotalCost(): ?float */ public function setTotalCost(?float $totalCost): self { + $this->initialized['totalCost'] = true; $this->totalCost = $totalCost; return $this; @@ -331,6 +351,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -349,6 +370,7 @@ public function getIsClosed(): ?bool */ public function setIsClosed(?bool $isClosed): self { + $this->initialized['isClosed'] = true; $this->isClosed = $isClosed; return $this; @@ -367,6 +389,7 @@ public function getIsLocked(): ?bool */ public function setIsLocked(?bool $isLocked): self { + $this->initialized['isLocked'] = true; $this->isLocked = $isLocked; return $this; @@ -385,6 +408,7 @@ public function getIsBilled(): ?bool */ public function setIsBilled(?bool $isBilled): self { + $this->initialized['isBilled'] = true; $this->isBilled = $isBilled; return $this; @@ -403,6 +427,7 @@ public function getLockedReason(): ?string */ public function setLockedReason(?string $lockedReason): self { + $this->initialized['lockedReason'] = true; $this->lockedReason = $lockedReason; return $this; @@ -421,6 +446,7 @@ public function getSpentDate(): ?\DateTime */ public function setSpentDate(?\DateTime $spentDate): self { + $this->initialized['spentDate'] = true; $this->spentDate = $spentDate; return $this; @@ -439,6 +465,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -457,6 +484,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/ExpenseCategories.php b/generated/Model/ExpenseCategories.php index 56370ed..6fdf375 100644 --- a/generated/Model/ExpenseCategories.php +++ b/generated/Model/ExpenseCategories.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseCategories +class ExpenseCategories extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var ExpenseCategory[] */ @@ -46,6 +50,11 @@ class ExpenseCategories */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return ExpenseCategory[] */ @@ -59,6 +68,7 @@ public function getExpenseCategories(): array */ public function setExpenseCategories(array $expenseCategories): self { + $this->initialized['expenseCategories'] = true; $this->expenseCategories = $expenseCategories; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php b/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php index 4481f54..21bf0dc 100644 --- a/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php +++ b/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseCategoriesExpenseCategoryIdPatchBody +class ExpenseCategoriesExpenseCategoryIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the expense category. * @@ -38,6 +42,11 @@ class ExpenseCategoriesExpenseCategoryIdPatchBody */ protected $isActive; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the expense category. */ @@ -51,6 +60,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -69,6 +79,7 @@ public function getUnitName(): ?string */ public function setUnitName(?string $unitName): self { + $this->initialized['unitName'] = true; $this->unitName = $unitName; return $this; @@ -87,6 +98,7 @@ public function getUnitPrice(): ?float */ public function setUnitPrice(?float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -105,6 +117,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; diff --git a/generated/Model/ExpenseCategoriesPostBody.php b/generated/Model/ExpenseCategoriesPostBody.php index 387ddbc..a8bbd3c 100644 --- a/generated/Model/ExpenseCategoriesPostBody.php +++ b/generated/Model/ExpenseCategoriesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseCategoriesPostBody +class ExpenseCategoriesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the expense category. * @@ -38,6 +42,11 @@ class ExpenseCategoriesPostBody */ protected $isActive; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the expense category. */ @@ -51,6 +60,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -69,6 +79,7 @@ public function getUnitName(): ?string */ public function setUnitName(?string $unitName): self { + $this->initialized['unitName'] = true; $this->unitName = $unitName; return $this; @@ -87,6 +98,7 @@ public function getUnitPrice(): ?float */ public function setUnitPrice(?float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -105,6 +117,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; diff --git a/generated/Model/ExpenseCategory.php b/generated/Model/ExpenseCategory.php index d3f0a10..a5883a5 100644 --- a/generated/Model/ExpenseCategory.php +++ b/generated/Model/ExpenseCategory.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseCategory +class ExpenseCategory extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the expense category. * @@ -56,6 +60,11 @@ class ExpenseCategory */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the expense category. */ @@ -69,6 +78,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -87,6 +97,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -105,6 +116,7 @@ public function getUnitName(): ?string */ public function setUnitName(?string $unitName): self { + $this->initialized['unitName'] = true; $this->unitName = $unitName; return $this; @@ -123,6 +135,7 @@ public function getUnitPrice(): ?float */ public function setUnitPrice(?float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -141,6 +154,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -159,6 +173,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -177,6 +192,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/ExpenseClient.php b/generated/Model/ExpenseClient.php index bfdbe46..77a35e2 100644 --- a/generated/Model/ExpenseClient.php +++ b/generated/Model/ExpenseClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseClient +class ExpenseClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class ExpenseClient */ protected $currency; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCurrency(): ?string public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; diff --git a/generated/Model/ExpenseExpenseCategory.php b/generated/Model/ExpenseExpenseCategory.php index 44cc202..2a0e218 100644 --- a/generated/Model/ExpenseExpenseCategory.php +++ b/generated/Model/ExpenseExpenseCategory.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseExpenseCategory +class ExpenseExpenseCategory extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -30,6 +34,11 @@ class ExpenseExpenseCategory */ protected $unitName; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -37,6 +46,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -49,6 +59,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -61,6 +72,7 @@ public function getUnitPrice(): ?string public function setUnitPrice(?string $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -73,6 +85,7 @@ public function getUnitName(): ?string public function setUnitName(?string $unitName): self { + $this->initialized['unitName'] = true; $this->unitName = $unitName; return $this; diff --git a/generated/Model/ExpenseInvoice.php b/generated/Model/ExpenseInvoice.php index 9a8e3c7..98341e2 100644 --- a/generated/Model/ExpenseInvoice.php +++ b/generated/Model/ExpenseInvoice.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseInvoice +class ExpenseInvoice extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class ExpenseInvoice */ protected $number; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getNumber(): ?string public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; diff --git a/generated/Model/ExpenseProject.php b/generated/Model/ExpenseProject.php index 2249695..61d7f22 100644 --- a/generated/Model/ExpenseProject.php +++ b/generated/Model/ExpenseProject.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseProject +class ExpenseProject extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class ExpenseProject */ protected $code; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCode(): ?string public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; diff --git a/generated/Model/ExpenseReceipt.php b/generated/Model/ExpenseReceipt.php index 7f0e8e4..c7e43cb 100644 --- a/generated/Model/ExpenseReceipt.php +++ b/generated/Model/ExpenseReceipt.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseReceipt +class ExpenseReceipt extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -30,6 +34,11 @@ class ExpenseReceipt */ protected $contentType; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getUrl(): ?string { return $this->url; @@ -37,6 +46,7 @@ public function getUrl(): ?string public function setUrl(?string $url): self { + $this->initialized['url'] = true; $this->url = $url; return $this; @@ -49,6 +59,7 @@ public function getFileName(): ?string public function setFileName(?string $fileName): self { + $this->initialized['fileName'] = true; $this->fileName = $fileName; return $this; @@ -61,6 +72,7 @@ public function getFileSize(): ?int public function setFileSize(?int $fileSize): self { + $this->initialized['fileSize'] = true; $this->fileSize = $fileSize; return $this; @@ -73,6 +85,7 @@ public function getContentType(): ?string public function setContentType(?string $contentType): self { + $this->initialized['contentType'] = true; $this->contentType = $contentType; return $this; diff --git a/generated/Model/ExpenseReportsResult.php b/generated/Model/ExpenseReportsResult.php index 5754d84..d4e73c3 100644 --- a/generated/Model/ExpenseReportsResult.php +++ b/generated/Model/ExpenseReportsResult.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseReportsResult +class ExpenseReportsResult extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client associated with the reported expenses. Only returned in the Client and Project reports. * @@ -86,6 +90,11 @@ class ExpenseReportsResult */ protected $currency; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client associated with the reported expenses. Only returned in the Client and Project reports. */ @@ -99,6 +108,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -117,6 +127,7 @@ public function getClientName(): ?string */ public function setClientName(?string $clientName): self { + $this->initialized['clientName'] = true; $this->clientName = $clientName; return $this; @@ -135,6 +146,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -153,6 +165,7 @@ public function getProjectName(): ?string */ public function setProjectName(?string $projectName): self { + $this->initialized['projectName'] = true; $this->projectName = $projectName; return $this; @@ -171,6 +184,7 @@ public function getExpenseCategoryId(): ?int */ public function setExpenseCategoryId(?int $expenseCategoryId): self { + $this->initialized['expenseCategoryId'] = true; $this->expenseCategoryId = $expenseCategoryId; return $this; @@ -189,6 +203,7 @@ public function getExpenseCategoryName(): ?string */ public function setExpenseCategoryName(?string $expenseCategoryName): self { + $this->initialized['expenseCategoryName'] = true; $this->expenseCategoryName = $expenseCategoryName; return $this; @@ -207,6 +222,7 @@ public function getUserId(): ?int */ public function setUserId(?int $userId): self { + $this->initialized['userId'] = true; $this->userId = $userId; return $this; @@ -225,6 +241,7 @@ public function getUserName(): ?string */ public function setUserName(?string $userName): self { + $this->initialized['userName'] = true; $this->userName = $userName; return $this; @@ -243,6 +260,7 @@ public function getIsContractor(): ?bool */ public function setIsContractor(?bool $isContractor): self { + $this->initialized['isContractor'] = true; $this->isContractor = $isContractor; return $this; @@ -261,6 +279,7 @@ public function getTotalAmount(): ?float */ public function setTotalAmount(?float $totalAmount): self { + $this->initialized['totalAmount'] = true; $this->totalAmount = $totalAmount; return $this; @@ -279,6 +298,7 @@ public function getBillableAmount(): ?float */ public function setBillableAmount(?float $billableAmount): self { + $this->initialized['billableAmount'] = true; $this->billableAmount = $billableAmount; return $this; @@ -297,6 +317,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; diff --git a/generated/Model/ExpenseReportsResults.php b/generated/Model/ExpenseReportsResults.php index 3695493..87faeb4 100644 --- a/generated/Model/ExpenseReportsResults.php +++ b/generated/Model/ExpenseReportsResults.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseReportsResults +class ExpenseReportsResults extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var ExpenseReportsResult[] */ @@ -46,6 +50,11 @@ class ExpenseReportsResults */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return ExpenseReportsResult[] */ @@ -59,6 +68,7 @@ public function getResults(): array */ public function setResults(array $results): self { + $this->initialized['results'] = true; $this->results = $results; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ExpenseUser.php b/generated/Model/ExpenseUser.php index b575925..bb4d61e 100644 --- a/generated/Model/ExpenseUser.php +++ b/generated/Model/ExpenseUser.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpenseUser +class ExpenseUser extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class ExpenseUser */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/Expenses.php b/generated/Model/Expenses.php index 2fe04df..5ecad06 100644 --- a/generated/Model/Expenses.php +++ b/generated/Model/Expenses.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Expenses +class Expenses extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Expense[] */ @@ -46,6 +50,11 @@ class Expenses */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Expense[] */ @@ -59,6 +68,7 @@ public function getExpenses(): array */ public function setExpenses(array $expenses): self { + $this->initialized['expenses'] = true; $this->expenses = $expenses; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ExpensesExpenseIdPatchBody.php b/generated/Model/ExpensesExpenseIdPatchBody.php index 6d16e6e..aab3b35 100644 --- a/generated/Model/ExpensesExpenseIdPatchBody.php +++ b/generated/Model/ExpensesExpenseIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpensesExpenseIdPatchBody +class ExpensesExpenseIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the project associated with this expense. * @@ -68,6 +72,11 @@ class ExpensesExpenseIdPatchBody */ protected $deleteReceipt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the project associated with this expense. */ @@ -81,6 +90,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -99,6 +109,7 @@ public function getExpenseCategoryId(): ?int */ public function setExpenseCategoryId(?int $expenseCategoryId): self { + $this->initialized['expenseCategoryId'] = true; $this->expenseCategoryId = $expenseCategoryId; return $this; @@ -117,6 +128,7 @@ public function getSpentDate(): ?\DateTime */ public function setSpentDate(?\DateTime $spentDate): self { + $this->initialized['spentDate'] = true; $this->spentDate = $spentDate; return $this; @@ -135,6 +147,7 @@ public function getUnits(): ?int */ public function setUnits(?int $units): self { + $this->initialized['units'] = true; $this->units = $units; return $this; @@ -153,6 +166,7 @@ public function getTotalCost(): ?float */ public function setTotalCost(?float $totalCost): self { + $this->initialized['totalCost'] = true; $this->totalCost = $totalCost; return $this; @@ -171,6 +185,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -189,6 +204,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -207,6 +223,7 @@ public function getReceipt(): ?string */ public function setReceipt(?string $receipt): self { + $this->initialized['receipt'] = true; $this->receipt = $receipt; return $this; @@ -225,6 +242,7 @@ public function getDeleteReceipt(): ?bool */ public function setDeleteReceipt(?bool $deleteReceipt): self { + $this->initialized['deleteReceipt'] = true; $this->deleteReceipt = $deleteReceipt; return $this; diff --git a/generated/Model/ExpensesPostBody.php b/generated/Model/ExpensesPostBody.php index 2008087..01e50ee 100644 --- a/generated/Model/ExpensesPostBody.php +++ b/generated/Model/ExpensesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ExpensesPostBody +class ExpensesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the user associated with this expense. Defaults to the ID of the currently authenticated user. * @@ -68,6 +72,11 @@ class ExpensesPostBody */ protected $receipt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the user associated with this expense. Defaults to the ID of the currently authenticated user. */ @@ -81,6 +90,7 @@ public function getUserId(): ?int */ public function setUserId(?int $userId): self { + $this->initialized['userId'] = true; $this->userId = $userId; return $this; @@ -99,6 +109,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -117,6 +128,7 @@ public function getExpenseCategoryId(): ?int */ public function setExpenseCategoryId(?int $expenseCategoryId): self { + $this->initialized['expenseCategoryId'] = true; $this->expenseCategoryId = $expenseCategoryId; return $this; @@ -135,6 +147,7 @@ public function getSpentDate(): ?\DateTime */ public function setSpentDate(?\DateTime $spentDate): self { + $this->initialized['spentDate'] = true; $this->spentDate = $spentDate; return $this; @@ -153,6 +166,7 @@ public function getUnits(): ?int */ public function setUnits(?int $units): self { + $this->initialized['units'] = true; $this->units = $units; return $this; @@ -171,6 +185,7 @@ public function getTotalCost(): ?float */ public function setTotalCost(?float $totalCost): self { + $this->initialized['totalCost'] = true; $this->totalCost = $totalCost; return $this; @@ -189,6 +204,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -207,6 +223,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -225,6 +242,7 @@ public function getReceipt(): ?string */ public function setReceipt(?string $receipt): self { + $this->initialized['receipt'] = true; $this->receipt = $receipt; return $this; diff --git a/generated/Model/Invoice.php b/generated/Model/Invoice.php index 66b53ee..155f235 100644 --- a/generated/Model/Invoice.php +++ b/generated/Model/Invoice.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Invoice +class Invoice extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the invoice. * @@ -50,7 +54,7 @@ class Invoice */ protected $creator; /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}. + * Used to build a URL to the public web invoice for your client by adding /client/invoices/{CLIENT_KEY} to your account URL https://{SUBDOMAIN}.harvestapp.com/ Note: you can also add .pdf to the end of this URL to access a PDF version of the invoice. * * @var string|null */ @@ -110,7 +114,7 @@ class Invoice */ protected $discount; /** - * The amount calcuated from discount. + * The amount calculated from discount. * * @var float|null */ @@ -212,6 +216,11 @@ class Invoice */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the invoice. */ @@ -225,6 +234,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -243,6 +253,7 @@ public function getClient(): ?InvoiceClient */ public function setClient(?InvoiceClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -265,6 +276,7 @@ public function getLineItems(): ?array */ public function setLineItems(?array $lineItems): self { + $this->initialized['lineItems'] = true; $this->lineItems = $lineItems; return $this; @@ -283,6 +295,7 @@ public function getEstimate(): ?InvoiceEstimate */ public function setEstimate(?InvoiceEstimate $estimate): self { + $this->initialized['estimate'] = true; $this->estimate = $estimate; return $this; @@ -301,6 +314,7 @@ public function getRetainer(): ?InvoiceRetainer */ public function setRetainer(?InvoiceRetainer $retainer): self { + $this->initialized['retainer'] = true; $this->retainer = $retainer; return $this; @@ -319,13 +333,14 @@ public function getCreator(): ?InvoiceCreator */ public function setCreator(?InvoiceCreator $creator): self { + $this->initialized['creator'] = true; $this->creator = $creator; return $this; } /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}. + * Used to build a URL to the public web invoice for your client by adding /client/invoices/{CLIENT_KEY} to your account URL https://{SUBDOMAIN}.harvestapp.com/ Note: you can also add .pdf to the end of this URL to access a PDF version of the invoice. */ public function getClientKey(): ?string { @@ -333,10 +348,11 @@ public function getClientKey(): ?string } /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}. + * Used to build a URL to the public web invoice for your client by adding /client/invoices/{CLIENT_KEY} to your account URL https://{SUBDOMAIN}.harvestapp.com/ Note: you can also add .pdf to the end of this URL to access a PDF version of the invoice. */ public function setClientKey(?string $clientKey): self { + $this->initialized['clientKey'] = true; $this->clientKey = $clientKey; return $this; @@ -355,6 +371,7 @@ public function getNumber(): ?string */ public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; @@ -373,6 +390,7 @@ public function getPurchaseOrder(): ?string */ public function setPurchaseOrder(?string $purchaseOrder): self { + $this->initialized['purchaseOrder'] = true; $this->purchaseOrder = $purchaseOrder; return $this; @@ -391,6 +409,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -409,6 +428,7 @@ public function getDueAmount(): ?float */ public function setDueAmount(?float $dueAmount): self { + $this->initialized['dueAmount'] = true; $this->dueAmount = $dueAmount; return $this; @@ -427,6 +447,7 @@ public function getTax(): ?float */ public function setTax(?float $tax): self { + $this->initialized['tax'] = true; $this->tax = $tax; return $this; @@ -445,6 +466,7 @@ public function getTaxAmount(): ?float */ public function setTaxAmount(?float $taxAmount): self { + $this->initialized['taxAmount'] = true; $this->taxAmount = $taxAmount; return $this; @@ -463,6 +485,7 @@ public function getTax2(): ?float */ public function setTax2(?float $tax2): self { + $this->initialized['tax2'] = true; $this->tax2 = $tax2; return $this; @@ -481,6 +504,7 @@ public function getTax2Amount(): ?float */ public function setTax2Amount(?float $tax2Amount): self { + $this->initialized['tax2Amount'] = true; $this->tax2Amount = $tax2Amount; return $this; @@ -499,13 +523,14 @@ public function getDiscount(): ?float */ public function setDiscount(?float $discount): self { + $this->initialized['discount'] = true; $this->discount = $discount; return $this; } /** - * The amount calcuated from discount. + * The amount calculated from discount. */ public function getDiscountAmount(): ?float { @@ -513,10 +538,11 @@ public function getDiscountAmount(): ?float } /** - * The amount calcuated from discount. + * The amount calculated from discount. */ public function setDiscountAmount(?float $discountAmount): self { + $this->initialized['discountAmount'] = true; $this->discountAmount = $discountAmount; return $this; @@ -535,6 +561,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -553,6 +580,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -571,6 +599,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -589,6 +618,7 @@ public function getState(): ?string */ public function setState(?string $state): self { + $this->initialized['state'] = true; $this->state = $state; return $this; @@ -607,6 +637,7 @@ public function getPeriodStart(): ?\DateTime */ public function setPeriodStart(?\DateTime $periodStart): self { + $this->initialized['periodStart'] = true; $this->periodStart = $periodStart; return $this; @@ -625,6 +656,7 @@ public function getPeriodEnd(): ?\DateTime */ public function setPeriodEnd(?\DateTime $periodEnd): self { + $this->initialized['periodEnd'] = true; $this->periodEnd = $periodEnd; return $this; @@ -643,6 +675,7 @@ public function getIssueDate(): ?\DateTime */ public function setIssueDate(?\DateTime $issueDate): self { + $this->initialized['issueDate'] = true; $this->issueDate = $issueDate; return $this; @@ -661,6 +694,7 @@ public function getDueDate(): ?\DateTime */ public function setDueDate(?\DateTime $dueDate): self { + $this->initialized['dueDate'] = true; $this->dueDate = $dueDate; return $this; @@ -679,6 +713,7 @@ public function getPaymentTerm(): ?string */ public function setPaymentTerm(?string $paymentTerm): self { + $this->initialized['paymentTerm'] = true; $this->paymentTerm = $paymentTerm; return $this; @@ -697,6 +732,7 @@ public function getSentAt(): ?\DateTime */ public function setSentAt(?\DateTime $sentAt): self { + $this->initialized['sentAt'] = true; $this->sentAt = $sentAt; return $this; @@ -715,6 +751,7 @@ public function getPaidAt(): ?\DateTime */ public function setPaidAt(?\DateTime $paidAt): self { + $this->initialized['paidAt'] = true; $this->paidAt = $paidAt; return $this; @@ -733,6 +770,7 @@ public function getPaidDate(): ?\DateTime */ public function setPaidDate(?\DateTime $paidDate): self { + $this->initialized['paidDate'] = true; $this->paidDate = $paidDate; return $this; @@ -751,6 +789,7 @@ public function getClosedAt(): ?\DateTime */ public function setClosedAt(?\DateTime $closedAt): self { + $this->initialized['closedAt'] = true; $this->closedAt = $closedAt; return $this; @@ -769,6 +808,7 @@ public function getRecurringInvoiceId(): ?int */ public function setRecurringInvoiceId(?int $recurringInvoiceId): self { + $this->initialized['recurringInvoiceId'] = true; $this->recurringInvoiceId = $recurringInvoiceId; return $this; @@ -787,6 +827,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -805,6 +846,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/InvoiceClient.php b/generated/Model/InvoiceClient.php index 3d27d11..eabf7b7 100644 --- a/generated/Model/InvoiceClient.php +++ b/generated/Model/InvoiceClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceClient +class InvoiceClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class InvoiceClient */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/InvoiceCreator.php b/generated/Model/InvoiceCreator.php index 2c7ec7e..001d204 100644 --- a/generated/Model/InvoiceCreator.php +++ b/generated/Model/InvoiceCreator.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceCreator +class InvoiceCreator extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class InvoiceCreator */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/InvoiceEstimate.php b/generated/Model/InvoiceEstimate.php index 1b16e44..9d04bca 100644 --- a/generated/Model/InvoiceEstimate.php +++ b/generated/Model/InvoiceEstimate.php @@ -11,13 +11,22 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceEstimate +class InvoiceEstimate extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ protected $id; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -25,6 +34,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; diff --git a/generated/Model/InvoiceItemCategories.php b/generated/Model/InvoiceItemCategories.php index 75e4dba..230ab9f 100644 --- a/generated/Model/InvoiceItemCategories.php +++ b/generated/Model/InvoiceItemCategories.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceItemCategories +class InvoiceItemCategories extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var InvoiceItemCategory[] */ @@ -46,6 +50,11 @@ class InvoiceItemCategories */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return InvoiceItemCategory[] */ @@ -59,6 +68,7 @@ public function getInvoiceItemCategories(): array */ public function setInvoiceItemCategories(array $invoiceItemCategories): self { + $this->initialized['invoiceItemCategories'] = true; $this->invoiceItemCategories = $invoiceItemCategories; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php b/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php index 9c901f6..9caa7ac 100644 --- a/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php +++ b/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody +class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the invoice item category. * @@ -20,6 +24,11 @@ class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the invoice item category. */ @@ -33,6 +42,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/InvoiceItemCategoriesPostBody.php b/generated/Model/InvoiceItemCategoriesPostBody.php index 6f9e6c6..12ce09c 100644 --- a/generated/Model/InvoiceItemCategoriesPostBody.php +++ b/generated/Model/InvoiceItemCategoriesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceItemCategoriesPostBody +class InvoiceItemCategoriesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the invoice item category. * @@ -20,6 +24,11 @@ class InvoiceItemCategoriesPostBody */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the invoice item category. */ @@ -33,6 +42,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/InvoiceItemCategory.php b/generated/Model/InvoiceItemCategory.php index 39e7b6e..e909e98 100644 --- a/generated/Model/InvoiceItemCategory.php +++ b/generated/Model/InvoiceItemCategory.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceItemCategory +class InvoiceItemCategory extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the invoice item category. * @@ -50,6 +54,11 @@ class InvoiceItemCategory */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the invoice item category. */ @@ -63,6 +72,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -81,6 +91,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -99,6 +110,7 @@ public function getUseAsService(): ?bool */ public function setUseAsService(?bool $useAsService): self { + $this->initialized['useAsService'] = true; $this->useAsService = $useAsService; return $this; @@ -117,6 +129,7 @@ public function getUseAsExpense(): ?bool */ public function setUseAsExpense(?bool $useAsExpense): self { + $this->initialized['useAsExpense'] = true; $this->useAsExpense = $useAsExpense; return $this; @@ -135,6 +148,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -153,6 +167,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/InvoiceLineItem.php b/generated/Model/InvoiceLineItem.php index 7c1b442..aa944e7 100644 --- a/generated/Model/InvoiceLineItem.php +++ b/generated/Model/InvoiceLineItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceLineItem +class InvoiceLineItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the line item. * @@ -68,6 +72,11 @@ class InvoiceLineItem */ protected $taxed2; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the line item. */ @@ -81,6 +90,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -99,6 +109,7 @@ public function getProject(): ?InvoiceLineItemProject */ public function setProject(?InvoiceLineItemProject $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; @@ -117,6 +128,7 @@ public function getKind(): ?string */ public function setKind(?string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; @@ -135,6 +147,7 @@ public function getDescription(): ?string */ public function setDescription(?string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -153,6 +166,7 @@ public function getQuantity(): ?float */ public function setQuantity(?float $quantity): self { + $this->initialized['quantity'] = true; $this->quantity = $quantity; return $this; @@ -171,6 +185,7 @@ public function getUnitPrice(): ?float */ public function setUnitPrice(?float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -189,6 +204,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -207,6 +223,7 @@ public function getTaxed(): ?bool */ public function setTaxed(?bool $taxed): self { + $this->initialized['taxed'] = true; $this->taxed = $taxed; return $this; @@ -225,6 +242,7 @@ public function getTaxed2(): ?bool */ public function setTaxed2(?bool $taxed2): self { + $this->initialized['taxed2'] = true; $this->taxed2 = $taxed2; return $this; diff --git a/generated/Model/InvoiceLineItemProject.php b/generated/Model/InvoiceLineItemProject.php index f749d1f..2946f81 100644 --- a/generated/Model/InvoiceLineItemProject.php +++ b/generated/Model/InvoiceLineItemProject.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceLineItemProject +class InvoiceLineItemProject extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class InvoiceLineItemProject */ protected $code; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCode(): ?string public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; diff --git a/generated/Model/InvoiceLineItems.php b/generated/Model/InvoiceLineItems.php index 888ff17..c31da48 100644 --- a/generated/Model/InvoiceLineItems.php +++ b/generated/Model/InvoiceLineItems.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceLineItems +class InvoiceLineItems extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var InvoiceLineItem[] */ @@ -46,6 +50,11 @@ class InvoiceLineItems */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return InvoiceLineItem[] */ @@ -59,6 +68,7 @@ public function getInvoiceLineItems(): array */ public function setInvoiceLineItems(array $invoiceLineItems): self { + $this->initialized['invoiceLineItems'] = true; $this->invoiceLineItems = $invoiceLineItems; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/InvoiceMessage.php b/generated/Model/InvoiceMessage.php index 4d86c82..92dfc7e 100644 --- a/generated/Model/InvoiceMessage.php +++ b/generated/Model/InvoiceMessage.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceMessage +class InvoiceMessage extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the message. * @@ -116,6 +120,11 @@ class InvoiceMessage */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the message. */ @@ -129,6 +138,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -147,6 +157,7 @@ public function getSentBy(): ?string */ public function setSentBy(?string $sentBy): self { + $this->initialized['sentBy'] = true; $this->sentBy = $sentBy; return $this; @@ -165,6 +176,7 @@ public function getSentByEmail(): ?string */ public function setSentByEmail(?string $sentByEmail): self { + $this->initialized['sentByEmail'] = true; $this->sentByEmail = $sentByEmail; return $this; @@ -183,6 +195,7 @@ public function getSentFrom(): ?string */ public function setSentFrom(?string $sentFrom): self { + $this->initialized['sentFrom'] = true; $this->sentFrom = $sentFrom; return $this; @@ -201,6 +214,7 @@ public function getSentFromEmail(): ?string */ public function setSentFromEmail(?string $sentFromEmail): self { + $this->initialized['sentFromEmail'] = true; $this->sentFromEmail = $sentFromEmail; return $this; @@ -223,6 +237,7 @@ public function getRecipients(): ?array */ public function setRecipients(?array $recipients): self { + $this->initialized['recipients'] = true; $this->recipients = $recipients; return $this; @@ -241,6 +256,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -259,6 +275,7 @@ public function getBody(): ?string */ public function setBody(?string $body): self { + $this->initialized['body'] = true; $this->body = $body; return $this; @@ -277,6 +294,7 @@ public function getIncludeLinkToClientInvoice(): ?bool */ public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice): self { + $this->initialized['includeLinkToClientInvoice'] = true; $this->includeLinkToClientInvoice = $includeLinkToClientInvoice; return $this; @@ -295,6 +313,7 @@ public function getAttachPdf(): ?bool */ public function setAttachPdf(?bool $attachPdf): self { + $this->initialized['attachPdf'] = true; $this->attachPdf = $attachPdf; return $this; @@ -313,6 +332,7 @@ public function getSendMeACopy(): ?bool */ public function setSendMeACopy(?bool $sendMeACopy): self { + $this->initialized['sendMeACopy'] = true; $this->sendMeACopy = $sendMeACopy; return $this; @@ -331,6 +351,7 @@ public function getThankYou(): ?bool */ public function setThankYou(?bool $thankYou): self { + $this->initialized['thankYou'] = true; $this->thankYou = $thankYou; return $this; @@ -349,6 +370,7 @@ public function getEventType(): ?string */ public function setEventType(?string $eventType): self { + $this->initialized['eventType'] = true; $this->eventType = $eventType; return $this; @@ -367,6 +389,7 @@ public function getReminder(): ?bool */ public function setReminder(?bool $reminder): self { + $this->initialized['reminder'] = true; $this->reminder = $reminder; return $this; @@ -385,6 +408,7 @@ public function getSendReminderOn(): ?\DateTime */ public function setSendReminderOn(?\DateTime $sendReminderOn): self { + $this->initialized['sendReminderOn'] = true; $this->sendReminderOn = $sendReminderOn; return $this; @@ -403,6 +427,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -421,6 +446,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/InvoiceMessageRecipient.php b/generated/Model/InvoiceMessageRecipient.php index 3c33f85..3da6716 100644 --- a/generated/Model/InvoiceMessageRecipient.php +++ b/generated/Model/InvoiceMessageRecipient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceMessageRecipient +class InvoiceMessageRecipient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Name of the message recipient. * @@ -26,6 +30,11 @@ class InvoiceMessageRecipient */ protected $email; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Name of the message recipient. */ @@ -39,6 +48,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +67,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; diff --git a/generated/Model/InvoiceMessageRecipients.php b/generated/Model/InvoiceMessageRecipients.php index 0d715d9..d2c5d9c 100644 --- a/generated/Model/InvoiceMessageRecipients.php +++ b/generated/Model/InvoiceMessageRecipients.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceMessageRecipients +class InvoiceMessageRecipients extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var InvoiceMessageRecipient[] */ @@ -46,6 +50,11 @@ class InvoiceMessageRecipients */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return InvoiceMessageRecipient[] */ @@ -59,6 +68,7 @@ public function getInvoiceMessageRecipients(): array */ public function setInvoiceMessageRecipients(array $invoiceMessageRecipients): self { + $this->initialized['invoiceMessageRecipients'] = true; $this->invoiceMessageRecipients = $invoiceMessageRecipients; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/InvoiceMessageSubjectAndBody.php b/generated/Model/InvoiceMessageSubjectAndBody.php index b1cfe83..430dee7 100644 --- a/generated/Model/InvoiceMessageSubjectAndBody.php +++ b/generated/Model/InvoiceMessageSubjectAndBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceMessageSubjectAndBody +class InvoiceMessageSubjectAndBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int */ @@ -34,6 +38,11 @@ class InvoiceMessageSubjectAndBody */ protected $thankYou; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getInvoiceId(): int { return $this->invoiceId; @@ -41,6 +50,7 @@ public function getInvoiceId(): int public function setInvoiceId(int $invoiceId): self { + $this->initialized['invoiceId'] = true; $this->invoiceId = $invoiceId; return $this; @@ -53,6 +63,7 @@ public function getSubject(): string public function setSubject(string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -65,6 +76,7 @@ public function getBody(): string public function setBody(string $body): self { + $this->initialized['body'] = true; $this->body = $body; return $this; @@ -77,6 +89,7 @@ public function getReminder(): bool public function setReminder(bool $reminder): self { + $this->initialized['reminder'] = true; $this->reminder = $reminder; return $this; @@ -89,6 +102,7 @@ public function getThankYou(): bool public function setThankYou(bool $thankYou): self { + $this->initialized['thankYou'] = true; $this->thankYou = $thankYou; return $this; diff --git a/generated/Model/InvoiceMessages.php b/generated/Model/InvoiceMessages.php index 53b0148..aef2ddd 100644 --- a/generated/Model/InvoiceMessages.php +++ b/generated/Model/InvoiceMessages.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceMessages +class InvoiceMessages extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var InvoiceMessage[] */ @@ -46,6 +50,11 @@ class InvoiceMessages */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return InvoiceMessage[] */ @@ -59,6 +68,7 @@ public function getInvoiceMessages(): array */ public function setInvoiceMessages(array $invoiceMessages): self { + $this->initialized['invoiceMessages'] = true; $this->invoiceMessages = $invoiceMessages; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/InvoicePayment.php b/generated/Model/InvoicePayment.php index 4897211..a9d6b7b 100644 --- a/generated/Model/InvoicePayment.php +++ b/generated/Model/InvoicePayment.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicePayment +class InvoicePayment extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the payment. * @@ -80,6 +84,11 @@ class InvoicePayment */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the payment. */ @@ -93,6 +102,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -111,6 +121,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -129,6 +140,7 @@ public function getPaidAt(): ?\DateTime */ public function setPaidAt(?\DateTime $paidAt): self { + $this->initialized['paidAt'] = true; $this->paidAt = $paidAt; return $this; @@ -147,6 +159,7 @@ public function getPaidDate(): ?\DateTime */ public function setPaidDate(?\DateTime $paidDate): self { + $this->initialized['paidDate'] = true; $this->paidDate = $paidDate; return $this; @@ -165,6 +178,7 @@ public function getRecordedBy(): ?string */ public function setRecordedBy(?string $recordedBy): self { + $this->initialized['recordedBy'] = true; $this->recordedBy = $recordedBy; return $this; @@ -183,6 +197,7 @@ public function getRecordedByEmail(): ?string */ public function setRecordedByEmail(?string $recordedByEmail): self { + $this->initialized['recordedByEmail'] = true; $this->recordedByEmail = $recordedByEmail; return $this; @@ -201,6 +216,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -219,6 +235,7 @@ public function getTransactionId(): ?string */ public function setTransactionId(?string $transactionId): self { + $this->initialized['transactionId'] = true; $this->transactionId = $transactionId; return $this; @@ -237,6 +254,7 @@ public function getPaymentGateway(): ?InvoicePaymentPaymentGateway */ public function setPaymentGateway(?InvoicePaymentPaymentGateway $paymentGateway): self { + $this->initialized['paymentGateway'] = true; $this->paymentGateway = $paymentGateway; return $this; @@ -255,6 +273,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -273,6 +292,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/InvoicePaymentPaymentGateway.php b/generated/Model/InvoicePaymentPaymentGateway.php index 51fcd53..124a852 100644 --- a/generated/Model/InvoicePaymentPaymentGateway.php +++ b/generated/Model/InvoicePaymentPaymentGateway.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicePaymentPaymentGateway +class InvoicePaymentPaymentGateway extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class InvoicePaymentPaymentGateway */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/InvoicePayments.php b/generated/Model/InvoicePayments.php index d38d13f..b0f2dc6 100644 --- a/generated/Model/InvoicePayments.php +++ b/generated/Model/InvoicePayments.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicePayments +class InvoicePayments extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var InvoicePayment[] */ @@ -46,6 +50,11 @@ class InvoicePayments */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return InvoicePayment[] */ @@ -59,6 +68,7 @@ public function getInvoicePayments(): array */ public function setInvoicePayments(array $invoicePayments): self { + $this->initialized['invoicePayments'] = true; $this->invoicePayments = $invoicePayments; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/InvoiceRetainer.php b/generated/Model/InvoiceRetainer.php index a5a37c4..cd42110 100644 --- a/generated/Model/InvoiceRetainer.php +++ b/generated/Model/InvoiceRetainer.php @@ -11,13 +11,22 @@ namespace JoliCode\Harvest\Api\Model; -class InvoiceRetainer +class InvoiceRetainer extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ protected $id; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -25,6 +34,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; diff --git a/generated/Model/Invoices.php b/generated/Model/Invoices.php index 880e3a4..a141b33 100644 --- a/generated/Model/Invoices.php +++ b/generated/Model/Invoices.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Invoices +class Invoices extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Invoice[] */ @@ -46,6 +50,11 @@ class Invoices */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Invoice[] */ @@ -59,6 +68,7 @@ public function getInvoices(): array */ public function setInvoices(array $invoices): self { + $this->initialized['invoices'] = true; $this->invoices = $invoices; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/InvoicesInvoiceIdMessagesPostBody.php b/generated/Model/InvoicesInvoiceIdMessagesPostBody.php index 547b2ab..d69c196 100644 --- a/generated/Model/InvoicesInvoiceIdMessagesPostBody.php +++ b/generated/Model/InvoicesInvoiceIdMessagesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesInvoiceIdMessagesPostBody +class InvoicesInvoiceIdMessagesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * If provided, runs an event against the invoice. Options: close, draft, re-open, or send. * @@ -62,6 +66,11 @@ class InvoicesInvoiceIdMessagesPostBody */ protected $thankYou; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * If provided, runs an event against the invoice. Options: close, draft, re-open, or send. */ @@ -75,6 +84,7 @@ public function getEventType(): ?string */ public function setEventType(?string $eventType): self { + $this->initialized['eventType'] = true; $this->eventType = $eventType; return $this; @@ -97,6 +107,7 @@ public function getRecipients(): ?array */ public function setRecipients(?array $recipients): self { + $this->initialized['recipients'] = true; $this->recipients = $recipients; return $this; @@ -115,6 +126,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -133,6 +145,7 @@ public function getBody(): ?string */ public function setBody(?string $body): self { + $this->initialized['body'] = true; $this->body = $body; return $this; @@ -151,6 +164,7 @@ public function getIncludeLinkToClientInvoice(): ?bool */ public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice): self { + $this->initialized['includeLinkToClientInvoice'] = true; $this->includeLinkToClientInvoice = $includeLinkToClientInvoice; return $this; @@ -169,6 +183,7 @@ public function getAttachPdf(): ?bool */ public function setAttachPdf(?bool $attachPdf): self { + $this->initialized['attachPdf'] = true; $this->attachPdf = $attachPdf; return $this; @@ -187,6 +202,7 @@ public function getSendMeACopy(): ?bool */ public function setSendMeACopy(?bool $sendMeACopy): self { + $this->initialized['sendMeACopy'] = true; $this->sendMeACopy = $sendMeACopy; return $this; @@ -205,6 +221,7 @@ public function getThankYou(): ?bool */ public function setThankYou(?bool $thankYou): self { + $this->initialized['thankYou'] = true; $this->thankYou = $thankYou; return $this; diff --git a/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php b/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php index 3a7baf0..5ad113c 100644 --- a/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php +++ b/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesInvoiceIdMessagesPostBodyRecipientsItem +class InvoicesInvoiceIdMessagesPostBodyRecipientsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Name of the message recipient. * @@ -26,6 +30,11 @@ class InvoicesInvoiceIdMessagesPostBodyRecipientsItem */ protected $email; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Name of the message recipient. */ @@ -39,6 +48,7 @@ public function getName(): string */ public function setName(string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +67,7 @@ public function getEmail(): string */ public function setEmail(string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; diff --git a/generated/Model/InvoicesInvoiceIdPatchBody.php b/generated/Model/InvoicesInvoiceIdPatchBody.php index f051fb1..1c7f95f 100644 --- a/generated/Model/InvoicesInvoiceIdPatchBody.php +++ b/generated/Model/InvoicesInvoiceIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesInvoiceIdPatchBody +class InvoicesInvoiceIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client this invoice belongs to. * @@ -104,6 +108,11 @@ class InvoicesInvoiceIdPatchBody */ protected $lineItems; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client this invoice belongs to. */ @@ -117,6 +126,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -135,6 +145,7 @@ public function getRetainerId(): ?int */ public function setRetainerId(?int $retainerId): self { + $this->initialized['retainerId'] = true; $this->retainerId = $retainerId; return $this; @@ -153,6 +164,7 @@ public function getEstimateId(): ?int */ public function setEstimateId(?int $estimateId): self { + $this->initialized['estimateId'] = true; $this->estimateId = $estimateId; return $this; @@ -171,6 +183,7 @@ public function getNumber(): ?string */ public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; @@ -189,6 +202,7 @@ public function getPurchaseOrder(): ?string */ public function setPurchaseOrder(?string $purchaseOrder): self { + $this->initialized['purchaseOrder'] = true; $this->purchaseOrder = $purchaseOrder; return $this; @@ -207,6 +221,7 @@ public function getTax(): ?float */ public function setTax(?float $tax): self { + $this->initialized['tax'] = true; $this->tax = $tax; return $this; @@ -225,6 +240,7 @@ public function getTax2(): ?float */ public function setTax2(?float $tax2): self { + $this->initialized['tax2'] = true; $this->tax2 = $tax2; return $this; @@ -243,6 +259,7 @@ public function getDiscount(): ?float */ public function setDiscount(?float $discount): self { + $this->initialized['discount'] = true; $this->discount = $discount; return $this; @@ -261,6 +278,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -279,6 +297,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -297,6 +316,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -315,6 +335,7 @@ public function getIssueDate(): ?\DateTime */ public function setIssueDate(?\DateTime $issueDate): self { + $this->initialized['issueDate'] = true; $this->issueDate = $issueDate; return $this; @@ -333,6 +354,7 @@ public function getDueDate(): ?\DateTime */ public function setDueDate(?\DateTime $dueDate): self { + $this->initialized['dueDate'] = true; $this->dueDate = $dueDate; return $this; @@ -351,6 +373,7 @@ public function getPaymentTerm(): ?string */ public function setPaymentTerm(?string $paymentTerm): self { + $this->initialized['paymentTerm'] = true; $this->paymentTerm = $paymentTerm; return $this; @@ -373,6 +396,7 @@ public function getLineItems(): ?array */ public function setLineItems(?array $lineItems): self { + $this->initialized['lineItems'] = true; $this->lineItems = $lineItems; return $this; diff --git a/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php b/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php index 21963b3..b6340a4 100644 --- a/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php +++ b/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesInvoiceIdPatchBodyLineItemsItem +class InvoicesInvoiceIdPatchBodyLineItemsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the line item. * @@ -62,6 +66,11 @@ class InvoicesInvoiceIdPatchBodyLineItemsItem */ protected $taxed2; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the line item. */ @@ -75,6 +84,7 @@ public function getId(): int */ public function setId(int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -93,6 +103,7 @@ public function getProjectId(): int */ public function setProjectId(int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -111,6 +122,7 @@ public function getKind(): string */ public function setKind(string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; @@ -129,6 +141,7 @@ public function getDescription(): string */ public function setDescription(string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -147,6 +160,7 @@ public function getQuantity(): float */ public function setQuantity(float $quantity): self { + $this->initialized['quantity'] = true; $this->quantity = $quantity; return $this; @@ -165,6 +179,7 @@ public function getUnitPrice(): float */ public function setUnitPrice(float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -183,6 +198,7 @@ public function getTaxed(): bool */ public function setTaxed(bool $taxed): self { + $this->initialized['taxed'] = true; $this->taxed = $taxed; return $this; @@ -201,6 +217,7 @@ public function getTaxed2(): bool */ public function setTaxed2(bool $taxed2): self { + $this->initialized['taxed2'] = true; $this->taxed2 = $taxed2; return $this; diff --git a/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php b/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php index ae5b38d..da1cbda 100644 --- a/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php +++ b/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesInvoiceIdPaymentsPostBody +class InvoicesInvoiceIdPaymentsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The amount of the payment. * @@ -38,6 +42,11 @@ class InvoicesInvoiceIdPaymentsPostBody */ protected $notes; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The amount of the payment. */ @@ -51,6 +60,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -69,6 +79,7 @@ public function getPaidAt(): ?\DateTime */ public function setPaidAt(?\DateTime $paidAt): self { + $this->initialized['paidAt'] = true; $this->paidAt = $paidAt; return $this; @@ -87,6 +98,7 @@ public function getPaidDate(): ?\DateTime */ public function setPaidDate(?\DateTime $paidDate): self { + $this->initialized['paidDate'] = true; $this->paidDate = $paidDate; return $this; @@ -105,6 +117,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; diff --git a/generated/Model/InvoicesPostBody.php b/generated/Model/InvoicesPostBody.php index 10ad6e4..7b9cb5a 100644 --- a/generated/Model/InvoicesPostBody.php +++ b/generated/Model/InvoicesPostBody.php @@ -11,20 +11,18 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesPostBody +class InvoicesPostBody extends \ArrayObject { /** - * The ID of the client this invoice belongs to. - * - * @var int|null + * @var array */ - protected $clientId; + protected $initialized = []; /** - * The ID of the retainer associated with this invoice. + * The ID of the client this invoice belongs to. * * @var int|null */ - protected $retainerId; + protected $clientId; /** * The ID of the estimate associated with this invoice. * @@ -86,7 +84,7 @@ class InvoicesPostBody */ protected $issueDate; /** - * Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calucated using the issue_date and the payment_term. + * Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calculated using the issue_date and the payment_term. * * @var \DateTime|null */ @@ -103,6 +101,12 @@ class InvoicesPostBody * @var InvoicesPostBodyLineItemsImport|null */ protected $lineItemsImport; + /** + * The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only avaiable action is to add funds. + * + * @var int|null + */ + protected $retainerId; /** * Array of line item parameters. * @@ -110,6 +114,11 @@ class InvoicesPostBody */ protected $lineItems; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client this invoice belongs to. */ @@ -123,29 +132,12 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; } - /** - * The ID of the retainer associated with this invoice. - */ - public function getRetainerId(): ?int - { - return $this->retainerId; - } - - /** - * The ID of the retainer associated with this invoice. - */ - public function setRetainerId(?int $retainerId): self - { - $this->retainerId = $retainerId; - - return $this; - } - /** * The ID of the estimate associated with this invoice. */ @@ -159,6 +151,7 @@ public function getEstimateId(): ?int */ public function setEstimateId(?int $estimateId): self { + $this->initialized['estimateId'] = true; $this->estimateId = $estimateId; return $this; @@ -177,6 +170,7 @@ public function getNumber(): ?string */ public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; @@ -195,6 +189,7 @@ public function getPurchaseOrder(): ?string */ public function setPurchaseOrder(?string $purchaseOrder): self { + $this->initialized['purchaseOrder'] = true; $this->purchaseOrder = $purchaseOrder; return $this; @@ -213,6 +208,7 @@ public function getTax(): ?float */ public function setTax(?float $tax): self { + $this->initialized['tax'] = true; $this->tax = $tax; return $this; @@ -231,6 +227,7 @@ public function getTax2(): ?float */ public function setTax2(?float $tax2): self { + $this->initialized['tax2'] = true; $this->tax2 = $tax2; return $this; @@ -249,6 +246,7 @@ public function getDiscount(): ?float */ public function setDiscount(?float $discount): self { + $this->initialized['discount'] = true; $this->discount = $discount; return $this; @@ -267,6 +265,7 @@ public function getSubject(): ?string */ public function setSubject(?string $subject): self { + $this->initialized['subject'] = true; $this->subject = $subject; return $this; @@ -285,6 +284,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -303,6 +303,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -321,13 +322,14 @@ public function getIssueDate(): ?\DateTime */ public function setIssueDate(?\DateTime $issueDate): self { + $this->initialized['issueDate'] = true; $this->issueDate = $issueDate; return $this; } /** - * Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calucated using the issue_date and the payment_term. + * Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calculated using the issue_date and the payment_term. */ public function getDueDate(): ?\DateTime { @@ -335,10 +337,11 @@ public function getDueDate(): ?\DateTime } /** - * Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calucated using the issue_date and the payment_term. + * Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom, otherwise the value supplied in the request for due_date will be ignored and the due_date will be calculated using the issue_date and the payment_term. */ public function setDueDate(?\DateTime $dueDate): self { + $this->initialized['dueDate'] = true; $this->dueDate = $dueDate; return $this; @@ -357,6 +360,7 @@ public function getPaymentTerm(): ?string */ public function setPaymentTerm(?string $paymentTerm): self { + $this->initialized['paymentTerm'] = true; $this->paymentTerm = $paymentTerm; return $this; @@ -375,11 +379,31 @@ public function getLineItemsImport(): ?InvoicesPostBodyLineItemsImport */ public function setLineItemsImport(?InvoicesPostBodyLineItemsImport $lineItemsImport): self { + $this->initialized['lineItemsImport'] = true; $this->lineItemsImport = $lineItemsImport; return $this; } + /** + * The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only avaiable action is to add funds. + */ + public function getRetainerId(): ?int + { + return $this->retainerId; + } + + /** + * The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only avaiable action is to add funds. + */ + public function setRetainerId(?int $retainerId): self + { + $this->initialized['retainerId'] = true; + $this->retainerId = $retainerId; + + return $this; + } + /** * Array of line item parameters. * @@ -397,6 +421,7 @@ public function getLineItems(): ?array */ public function setLineItems(?array $lineItems): self { + $this->initialized['lineItems'] = true; $this->lineItems = $lineItems; return $this; diff --git a/generated/Model/InvoicesPostBodyLineItemsImport.php b/generated/Model/InvoicesPostBodyLineItemsImport.php index 5d9f6f6..e6b064a 100644 --- a/generated/Model/InvoicesPostBodyLineItemsImport.php +++ b/generated/Model/InvoicesPostBodyLineItemsImport.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesPostBodyLineItemsImport +class InvoicesPostBodyLineItemsImport extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * An array of the client’s project IDs you’d like to include time/expenses from. * @@ -32,6 +36,11 @@ class InvoicesPostBodyLineItemsImport */ protected $expenses; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * An array of the client’s project IDs you’d like to include time/expenses from. * @@ -49,6 +58,7 @@ public function getProjectIds(): array */ public function setProjectIds(array $projectIds): self { + $this->initialized['projectIds'] = true; $this->projectIds = $projectIds; return $this; @@ -67,6 +77,7 @@ public function getTime(): InvoicesPostBodyLineItemsImportTime */ public function setTime(InvoicesPostBodyLineItemsImportTime $time): self { + $this->initialized['time'] = true; $this->time = $time; return $this; @@ -85,6 +96,7 @@ public function getExpenses(): InvoicesPostBodyLineItemsImportExpenses */ public function setExpenses(InvoicesPostBodyLineItemsImportExpenses $expenses): self { + $this->initialized['expenses'] = true; $this->expenses = $expenses; return $this; diff --git a/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php b/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php index b046d11..ecd0f36 100644 --- a/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php +++ b/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesPostBodyLineItemsImportExpenses +class InvoicesPostBodyLineItemsImportExpenses extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * How to summarize the expenses per line item. Options: project, category, people, or detailed. * @@ -38,6 +42,11 @@ class InvoicesPostBodyLineItemsImportExpenses */ protected $attachReceipt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * How to summarize the expenses per line item. Options: project, category, people, or detailed. */ @@ -51,6 +60,7 @@ public function getSummaryType(): string */ public function setSummaryType(string $summaryType): self { + $this->initialized['summaryType'] = true; $this->summaryType = $summaryType; return $this; @@ -69,6 +79,7 @@ public function getFrom(): \DateTime */ public function setFrom(\DateTime $from): self { + $this->initialized['from'] = true; $this->from = $from; return $this; @@ -87,6 +98,7 @@ public function getTo(): \DateTime */ public function setTo(\DateTime $to): self { + $this->initialized['to'] = true; $this->to = $to; return $this; @@ -105,6 +117,7 @@ public function getAttachReceipt(): bool */ public function setAttachReceipt(bool $attachReceipt): self { + $this->initialized['attachReceipt'] = true; $this->attachReceipt = $attachReceipt; return $this; diff --git a/generated/Model/InvoicesPostBodyLineItemsImportTime.php b/generated/Model/InvoicesPostBodyLineItemsImportTime.php index f8397e4..c5d7cd8 100644 --- a/generated/Model/InvoicesPostBodyLineItemsImportTime.php +++ b/generated/Model/InvoicesPostBodyLineItemsImportTime.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesPostBodyLineItemsImportTime +class InvoicesPostBodyLineItemsImportTime extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * How to summarize the time entries per line item. Options: project, task, people, or detailed. * @@ -32,6 +36,11 @@ class InvoicesPostBodyLineItemsImportTime */ protected $to; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * How to summarize the time entries per line item. Options: project, task, people, or detailed. */ @@ -45,6 +54,7 @@ public function getSummaryType(): string */ public function setSummaryType(string $summaryType): self { + $this->initialized['summaryType'] = true; $this->summaryType = $summaryType; return $this; @@ -63,6 +73,7 @@ public function getFrom(): \DateTime */ public function setFrom(\DateTime $from): self { + $this->initialized['from'] = true; $this->from = $from; return $this; @@ -81,6 +92,7 @@ public function getTo(): \DateTime */ public function setTo(\DateTime $to): self { + $this->initialized['to'] = true; $this->to = $to; return $this; diff --git a/generated/Model/InvoicesPostBodyLineItemsItem.php b/generated/Model/InvoicesPostBodyLineItemsItem.php index 637f0e1..bf2eb96 100644 --- a/generated/Model/InvoicesPostBodyLineItemsItem.php +++ b/generated/Model/InvoicesPostBodyLineItemsItem.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class InvoicesPostBodyLineItemsItem +class InvoicesPostBodyLineItemsItem extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the project associated with this line item. * @@ -56,6 +60,11 @@ class InvoicesPostBodyLineItemsItem */ protected $taxed2; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the project associated with this line item. */ @@ -69,6 +78,7 @@ public function getProjectId(): int */ public function setProjectId(int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -87,6 +97,7 @@ public function getKind(): string */ public function setKind(string $kind): self { + $this->initialized['kind'] = true; $this->kind = $kind; return $this; @@ -105,6 +116,7 @@ public function getDescription(): string */ public function setDescription(string $description): self { + $this->initialized['description'] = true; $this->description = $description; return $this; @@ -123,6 +135,7 @@ public function getQuantity(): float */ public function setQuantity(float $quantity): self { + $this->initialized['quantity'] = true; $this->quantity = $quantity; return $this; @@ -141,6 +154,7 @@ public function getUnitPrice(): float */ public function setUnitPrice(float $unitPrice): self { + $this->initialized['unitPrice'] = true; $this->unitPrice = $unitPrice; return $this; @@ -159,6 +173,7 @@ public function getTaxed(): bool */ public function setTaxed(bool $taxed): self { + $this->initialized['taxed'] = true; $this->taxed = $taxed; return $this; @@ -177,6 +192,7 @@ public function getTaxed2(): bool */ public function setTaxed2(bool $taxed2): self { + $this->initialized['taxed2'] = true; $this->taxed2 = $taxed2; return $this; diff --git a/generated/Model/PaginationLinks.php b/generated/Model/PaginationLinks.php index f624381..53e975f 100644 --- a/generated/Model/PaginationLinks.php +++ b/generated/Model/PaginationLinks.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class PaginationLinks +class PaginationLinks extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * First page. * @@ -38,6 +42,11 @@ class PaginationLinks */ protected $next; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * First page. */ @@ -51,6 +60,7 @@ public function getFirst(): string */ public function setFirst(string $first): self { + $this->initialized['first'] = true; $this->first = $first; return $this; @@ -69,6 +79,7 @@ public function getLast(): string */ public function setLast(string $last): self { + $this->initialized['last'] = true; $this->last = $last; return $this; @@ -87,6 +98,7 @@ public function getPrevious(): ?string */ public function setPrevious(?string $previous): self { + $this->initialized['previous'] = true; $this->previous = $previous; return $this; @@ -105,6 +117,7 @@ public function getNext(): ?string */ public function setNext(?string $next): self { + $this->initialized['next'] = true; $this->next = $next; return $this; diff --git a/generated/Model/Project.php b/generated/Model/Project.php index 6a88d1a..f39743d 100644 --- a/generated/Model/Project.php +++ b/generated/Model/Project.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Project +class Project extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the project. * @@ -158,6 +162,11 @@ class Project */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the project. */ @@ -171,6 +180,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -189,6 +199,7 @@ public function getClient(): ?ProjectClient */ public function setClient(?ProjectClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -207,6 +218,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -225,6 +237,7 @@ public function getCode(): ?string */ public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; @@ -243,6 +256,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -261,6 +275,7 @@ public function getIsBillable(): ?bool */ public function setIsBillable(?bool $isBillable): self { + $this->initialized['isBillable'] = true; $this->isBillable = $isBillable; return $this; @@ -279,6 +294,7 @@ public function getIsFixedFee(): ?bool */ public function setIsFixedFee(?bool $isFixedFee): self { + $this->initialized['isFixedFee'] = true; $this->isFixedFee = $isFixedFee; return $this; @@ -297,6 +313,7 @@ public function getBillBy(): ?string */ public function setBillBy(?string $billBy): self { + $this->initialized['billBy'] = true; $this->billBy = $billBy; return $this; @@ -315,6 +332,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -333,6 +351,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -351,6 +370,7 @@ public function getBudgetBy(): ?string */ public function setBudgetBy(?string $budgetBy): self { + $this->initialized['budgetBy'] = true; $this->budgetBy = $budgetBy; return $this; @@ -369,6 +389,7 @@ public function getBudgetIsMonthly(): ?bool */ public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { + $this->initialized['budgetIsMonthly'] = true; $this->budgetIsMonthly = $budgetIsMonthly; return $this; @@ -387,6 +408,7 @@ public function getNotifyWhenOverBudget(): ?bool */ public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget): self { + $this->initialized['notifyWhenOverBudget'] = true; $this->notifyWhenOverBudget = $notifyWhenOverBudget; return $this; @@ -405,6 +427,7 @@ public function getOverBudgetNotificationPercentage(): ?float */ public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage): self { + $this->initialized['overBudgetNotificationPercentage'] = true; $this->overBudgetNotificationPercentage = $overBudgetNotificationPercentage; return $this; @@ -423,6 +446,7 @@ public function getOverBudgetNotificationDate(): ?\DateTime */ public function setOverBudgetNotificationDate(?\DateTime $overBudgetNotificationDate): self { + $this->initialized['overBudgetNotificationDate'] = true; $this->overBudgetNotificationDate = $overBudgetNotificationDate; return $this; @@ -441,6 +465,7 @@ public function getShowBudgetToAll(): ?bool */ public function setShowBudgetToAll(?bool $showBudgetToAll): self { + $this->initialized['showBudgetToAll'] = true; $this->showBudgetToAll = $showBudgetToAll; return $this; @@ -459,6 +484,7 @@ public function getCostBudget(): ?float */ public function setCostBudget(?float $costBudget): self { + $this->initialized['costBudget'] = true; $this->costBudget = $costBudget; return $this; @@ -477,6 +503,7 @@ public function getCostBudgetIncludeExpenses(): ?bool */ public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses): self { + $this->initialized['costBudgetIncludeExpenses'] = true; $this->costBudgetIncludeExpenses = $costBudgetIncludeExpenses; return $this; @@ -495,6 +522,7 @@ public function getFee(): ?float */ public function setFee(?float $fee): self { + $this->initialized['fee'] = true; $this->fee = $fee; return $this; @@ -513,6 +541,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -531,6 +560,7 @@ public function getStartsOn(): ?\DateTime */ public function setStartsOn(?\DateTime $startsOn): self { + $this->initialized['startsOn'] = true; $this->startsOn = $startsOn; return $this; @@ -549,6 +579,7 @@ public function getEndsOn(): ?\DateTime */ public function setEndsOn(?\DateTime $endsOn): self { + $this->initialized['endsOn'] = true; $this->endsOn = $endsOn; return $this; @@ -567,6 +598,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -585,6 +617,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/ProjectAssignment.php b/generated/Model/ProjectAssignment.php index 7ef30b1..46effa7 100644 --- a/generated/Model/ProjectAssignment.php +++ b/generated/Model/ProjectAssignment.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectAssignment +class ProjectAssignment extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the project assignment. * @@ -80,6 +84,11 @@ class ProjectAssignment */ protected $taskAssignments; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the project assignment. */ @@ -93,6 +102,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -111,6 +121,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -129,6 +140,7 @@ public function getIsProjectManager(): ?bool */ public function setIsProjectManager(?bool $isProjectManager): self { + $this->initialized['isProjectManager'] = true; $this->isProjectManager = $isProjectManager; return $this; @@ -147,6 +159,7 @@ public function getUseDefaultRates(): ?bool */ public function setUseDefaultRates(?bool $useDefaultRates): self { + $this->initialized['useDefaultRates'] = true; $this->useDefaultRates = $useDefaultRates; return $this; @@ -165,6 +178,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -183,6 +197,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -201,6 +216,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -219,6 +235,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; @@ -237,6 +254,7 @@ public function getProject(): ?ProjectAssignmentProject */ public function setProject(?ProjectAssignmentProject $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; @@ -255,6 +273,7 @@ public function getClient(): ?ProjectAssignmentClient */ public function setClient(?ProjectAssignmentClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -277,6 +296,7 @@ public function getTaskAssignments(): ?array */ public function setTaskAssignments(?array $taskAssignments): self { + $this->initialized['taskAssignments'] = true; $this->taskAssignments = $taskAssignments; return $this; diff --git a/generated/Model/ProjectAssignmentClient.php b/generated/Model/ProjectAssignmentClient.php index 782df13..c4fb8d8 100644 --- a/generated/Model/ProjectAssignmentClient.php +++ b/generated/Model/ProjectAssignmentClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectAssignmentClient +class ProjectAssignmentClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class ProjectAssignmentClient */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/ProjectAssignmentProject.php b/generated/Model/ProjectAssignmentProject.php index 29c68e7..b441c66 100644 --- a/generated/Model/ProjectAssignmentProject.php +++ b/generated/Model/ProjectAssignmentProject.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectAssignmentProject +class ProjectAssignmentProject extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class ProjectAssignmentProject */ protected $code; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCode(): ?string public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; diff --git a/generated/Model/ProjectAssignments.php b/generated/Model/ProjectAssignments.php index 436b6c8..9588ea8 100644 --- a/generated/Model/ProjectAssignments.php +++ b/generated/Model/ProjectAssignments.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectAssignments +class ProjectAssignments extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var ProjectAssignment[] */ @@ -46,6 +50,11 @@ class ProjectAssignments */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return ProjectAssignment[] */ @@ -59,6 +68,7 @@ public function getProjectAssignments(): array */ public function setProjectAssignments(array $projectAssignments): self { + $this->initialized['projectAssignments'] = true; $this->projectAssignments = $projectAssignments; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ProjectBudgetReportResult.php b/generated/Model/ProjectBudgetReportResult.php index 36dc607..85646bf 100644 --- a/generated/Model/ProjectBudgetReportResult.php +++ b/generated/Model/ProjectBudgetReportResult.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectBudgetReportResult +class ProjectBudgetReportResult extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client associated with this project. * @@ -74,6 +78,11 @@ class ProjectBudgetReportResult */ protected $budgetRemaining; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client associated with this project. */ @@ -87,6 +96,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -105,6 +115,7 @@ public function getClientName(): ?string */ public function setClientName(?string $clientName): self { + $this->initialized['clientName'] = true; $this->clientName = $clientName; return $this; @@ -123,6 +134,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -141,6 +153,7 @@ public function getProjectName(): ?string */ public function setProjectName(?string $projectName): self { + $this->initialized['projectName'] = true; $this->projectName = $projectName; return $this; @@ -159,6 +172,7 @@ public function getBudgetIsMonthly(): ?bool */ public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { + $this->initialized['budgetIsMonthly'] = true; $this->budgetIsMonthly = $budgetIsMonthly; return $this; @@ -177,6 +191,7 @@ public function getBudgetBy(): ?string */ public function setBudgetBy(?string $budgetBy): self { + $this->initialized['budgetBy'] = true; $this->budgetBy = $budgetBy; return $this; @@ -195,6 +210,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -213,6 +229,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -231,6 +248,7 @@ public function getBudgetSpent(): ?float */ public function setBudgetSpent(?float $budgetSpent): self { + $this->initialized['budgetSpent'] = true; $this->budgetSpent = $budgetSpent; return $this; @@ -249,6 +267,7 @@ public function getBudgetRemaining(): ?float */ public function setBudgetRemaining(?float $budgetRemaining): self { + $this->initialized['budgetRemaining'] = true; $this->budgetRemaining = $budgetRemaining; return $this; diff --git a/generated/Model/ProjectBudgetReportResults.php b/generated/Model/ProjectBudgetReportResults.php index f51051b..da16c90 100644 --- a/generated/Model/ProjectBudgetReportResults.php +++ b/generated/Model/ProjectBudgetReportResults.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectBudgetReportResults +class ProjectBudgetReportResults extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var ProjectBudgetReportResult[] */ @@ -46,6 +50,11 @@ class ProjectBudgetReportResults */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return ProjectBudgetReportResult[] */ @@ -59,6 +68,7 @@ public function getResults(): array */ public function setResults(array $results): self { + $this->initialized['results'] = true; $this->results = $results; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ProjectClient.php b/generated/Model/ProjectClient.php index 233851a..35caee4 100644 --- a/generated/Model/ProjectClient.php +++ b/generated/Model/ProjectClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectClient +class ProjectClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class ProjectClient */ protected $currency; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCurrency(): ?string public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; diff --git a/generated/Model/Projects.php b/generated/Model/Projects.php index aa29c84..0d94b79 100644 --- a/generated/Model/Projects.php +++ b/generated/Model/Projects.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Projects +class Projects extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Project[] */ @@ -46,6 +50,11 @@ class Projects */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Project[] */ @@ -59,6 +68,7 @@ public function getProjects(): array */ public function setProjects(array $projects): self { + $this->initialized['projects'] = true; $this->projects = $projects; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/ProjectsPostBody.php b/generated/Model/ProjectsPostBody.php index 8082dfd..710c551 100644 --- a/generated/Model/ProjectsPostBody.php +++ b/generated/Model/ProjectsPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectsPostBody +class ProjectsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client to associate this project with. * @@ -134,6 +138,11 @@ class ProjectsPostBody */ protected $endsOn; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client to associate this project with. */ @@ -147,6 +156,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -165,6 +175,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -183,6 +194,7 @@ public function getCode(): ?string */ public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; @@ -201,6 +213,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -219,6 +232,7 @@ public function getIsBillable(): ?bool */ public function setIsBillable(?bool $isBillable): self { + $this->initialized['isBillable'] = true; $this->isBillable = $isBillable; return $this; @@ -237,6 +251,7 @@ public function getIsFixedFee(): ?bool */ public function setIsFixedFee(?bool $isFixedFee): self { + $this->initialized['isFixedFee'] = true; $this->isFixedFee = $isFixedFee; return $this; @@ -255,6 +270,7 @@ public function getBillBy(): ?string */ public function setBillBy(?string $billBy): self { + $this->initialized['billBy'] = true; $this->billBy = $billBy; return $this; @@ -273,6 +289,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -291,6 +308,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -309,6 +327,7 @@ public function getBudgetBy(): ?string */ public function setBudgetBy(?string $budgetBy): self { + $this->initialized['budgetBy'] = true; $this->budgetBy = $budgetBy; return $this; @@ -327,6 +346,7 @@ public function getBudgetIsMonthly(): ?bool */ public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { + $this->initialized['budgetIsMonthly'] = true; $this->budgetIsMonthly = $budgetIsMonthly; return $this; @@ -345,6 +365,7 @@ public function getNotifyWhenOverBudget(): ?bool */ public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget): self { + $this->initialized['notifyWhenOverBudget'] = true; $this->notifyWhenOverBudget = $notifyWhenOverBudget; return $this; @@ -363,6 +384,7 @@ public function getOverBudgetNotificationPercentage(): ?float */ public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage): self { + $this->initialized['overBudgetNotificationPercentage'] = true; $this->overBudgetNotificationPercentage = $overBudgetNotificationPercentage; return $this; @@ -381,6 +403,7 @@ public function getShowBudgetToAll(): ?bool */ public function setShowBudgetToAll(?bool $showBudgetToAll): self { + $this->initialized['showBudgetToAll'] = true; $this->showBudgetToAll = $showBudgetToAll; return $this; @@ -399,6 +422,7 @@ public function getCostBudget(): ?float */ public function setCostBudget(?float $costBudget): self { + $this->initialized['costBudget'] = true; $this->costBudget = $costBudget; return $this; @@ -417,6 +441,7 @@ public function getCostBudgetIncludeExpenses(): ?bool */ public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses): self { + $this->initialized['costBudgetIncludeExpenses'] = true; $this->costBudgetIncludeExpenses = $costBudgetIncludeExpenses; return $this; @@ -435,6 +460,7 @@ public function getFee(): ?float */ public function setFee(?float $fee): self { + $this->initialized['fee'] = true; $this->fee = $fee; return $this; @@ -453,6 +479,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -471,6 +498,7 @@ public function getStartsOn(): ?\DateTime */ public function setStartsOn(?\DateTime $startsOn): self { + $this->initialized['startsOn'] = true; $this->startsOn = $startsOn; return $this; @@ -489,6 +517,7 @@ public function getEndsOn(): ?\DateTime */ public function setEndsOn(?\DateTime $endsOn): self { + $this->initialized['endsOn'] = true; $this->endsOn = $endsOn; return $this; diff --git a/generated/Model/ProjectsProjectIdPatchBody.php b/generated/Model/ProjectsProjectIdPatchBody.php index 30a6ce6..0ab259c 100644 --- a/generated/Model/ProjectsProjectIdPatchBody.php +++ b/generated/Model/ProjectsProjectIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectsProjectIdPatchBody +class ProjectsProjectIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client to associate this project with. * @@ -134,6 +138,11 @@ class ProjectsProjectIdPatchBody */ protected $endsOn; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client to associate this project with. */ @@ -147,6 +156,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -165,6 +175,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -183,6 +194,7 @@ public function getCode(): ?string */ public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; @@ -201,6 +213,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -219,6 +232,7 @@ public function getIsBillable(): ?bool */ public function setIsBillable(?bool $isBillable): self { + $this->initialized['isBillable'] = true; $this->isBillable = $isBillable; return $this; @@ -237,6 +251,7 @@ public function getIsFixedFee(): ?bool */ public function setIsFixedFee(?bool $isFixedFee): self { + $this->initialized['isFixedFee'] = true; $this->isFixedFee = $isFixedFee; return $this; @@ -255,6 +270,7 @@ public function getBillBy(): ?string */ public function setBillBy(?string $billBy): self { + $this->initialized['billBy'] = true; $this->billBy = $billBy; return $this; @@ -273,6 +289,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -291,6 +308,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -309,6 +327,7 @@ public function getBudgetBy(): ?string */ public function setBudgetBy(?string $budgetBy): self { + $this->initialized['budgetBy'] = true; $this->budgetBy = $budgetBy; return $this; @@ -327,6 +346,7 @@ public function getBudgetIsMonthly(): ?bool */ public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { + $this->initialized['budgetIsMonthly'] = true; $this->budgetIsMonthly = $budgetIsMonthly; return $this; @@ -345,6 +365,7 @@ public function getNotifyWhenOverBudget(): ?bool */ public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget): self { + $this->initialized['notifyWhenOverBudget'] = true; $this->notifyWhenOverBudget = $notifyWhenOverBudget; return $this; @@ -363,6 +384,7 @@ public function getOverBudgetNotificationPercentage(): ?float */ public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage): self { + $this->initialized['overBudgetNotificationPercentage'] = true; $this->overBudgetNotificationPercentage = $overBudgetNotificationPercentage; return $this; @@ -381,6 +403,7 @@ public function getShowBudgetToAll(): ?bool */ public function setShowBudgetToAll(?bool $showBudgetToAll): self { + $this->initialized['showBudgetToAll'] = true; $this->showBudgetToAll = $showBudgetToAll; return $this; @@ -399,6 +422,7 @@ public function getCostBudget(): ?float */ public function setCostBudget(?float $costBudget): self { + $this->initialized['costBudget'] = true; $this->costBudget = $costBudget; return $this; @@ -417,6 +441,7 @@ public function getCostBudgetIncludeExpenses(): ?bool */ public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses): self { + $this->initialized['costBudgetIncludeExpenses'] = true; $this->costBudgetIncludeExpenses = $costBudgetIncludeExpenses; return $this; @@ -435,6 +460,7 @@ public function getFee(): ?float */ public function setFee(?float $fee): self { + $this->initialized['fee'] = true; $this->fee = $fee; return $this; @@ -453,6 +479,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -471,6 +498,7 @@ public function getStartsOn(): ?\DateTime */ public function setStartsOn(?\DateTime $startsOn): self { + $this->initialized['startsOn'] = true; $this->startsOn = $startsOn; return $this; @@ -489,6 +517,7 @@ public function getEndsOn(): ?\DateTime */ public function setEndsOn(?\DateTime $endsOn): self { + $this->initialized['endsOn'] = true; $this->endsOn = $endsOn; return $this; diff --git a/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php b/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php index 1aad18d..8b5046b 100644 --- a/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php +++ b/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectsProjectIdTaskAssignmentsPostBody +class ProjectsProjectIdTaskAssignmentsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the task to associate with the project. * @@ -44,6 +48,11 @@ class ProjectsProjectIdTaskAssignmentsPostBody */ protected $budget; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the task to associate with the project. */ @@ -57,6 +66,7 @@ public function getTaskId(): ?int */ public function setTaskId(?int $taskId): self { + $this->initialized['taskId'] = true; $this->taskId = $taskId; return $this; @@ -75,6 +85,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -93,6 +104,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -111,6 +123,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -129,6 +142,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; diff --git a/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php b/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php index c03567f..9042d02 100644 --- a/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php +++ b/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody +class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Whether the task assignment is active or archived. * @@ -38,6 +42,11 @@ class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody */ protected $budget; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Whether the task assignment is active or archived. */ @@ -51,6 +60,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -69,6 +79,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -87,6 +98,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -105,6 +117,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; diff --git a/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php b/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php index 25bdb21..ba4ddfd 100644 --- a/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php +++ b/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectsProjectIdUserAssignmentsPostBody +class ProjectsProjectIdUserAssignmentsPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the user to associate with the project. * @@ -50,6 +54,11 @@ class ProjectsProjectIdUserAssignmentsPostBody */ protected $budget; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the user to associate with the project. */ @@ -63,6 +72,7 @@ public function getUserId(): ?int */ public function setUserId(?int $userId): self { + $this->initialized['userId'] = true; $this->userId = $userId; return $this; @@ -81,6 +91,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -99,6 +110,7 @@ public function getIsProjectManager(): ?bool */ public function setIsProjectManager(?bool $isProjectManager): self { + $this->initialized['isProjectManager'] = true; $this->isProjectManager = $isProjectManager; return $this; @@ -117,6 +129,7 @@ public function getUseDefaultRates(): ?bool */ public function setUseDefaultRates(?bool $useDefaultRates): self { + $this->initialized['useDefaultRates'] = true; $this->useDefaultRates = $useDefaultRates; return $this; @@ -135,6 +148,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -153,6 +167,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; diff --git a/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php b/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php index 80d4477..6e5d2a7 100644 --- a/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php +++ b/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody +class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Whether the user assignment is active or archived. * @@ -44,6 +48,11 @@ class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody */ protected $budget; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Whether the user assignment is active or archived. */ @@ -57,6 +66,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -75,6 +85,7 @@ public function getIsProjectManager(): ?bool */ public function setIsProjectManager(?bool $isProjectManager): self { + $this->initialized['isProjectManager'] = true; $this->isProjectManager = $isProjectManager; return $this; @@ -93,6 +104,7 @@ public function getUseDefaultRates(): ?bool */ public function setUseDefaultRates(?bool $useDefaultRates): self { + $this->initialized['useDefaultRates'] = true; $this->useDefaultRates = $useDefaultRates; return $this; @@ -111,6 +123,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -129,6 +142,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; diff --git a/generated/Model/Role.php b/generated/Model/Role.php index 2c8f9e6..427d7d8 100644 --- a/generated/Model/Role.php +++ b/generated/Model/Role.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Role +class Role extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the role. * @@ -44,6 +48,11 @@ class Role */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the role. */ @@ -57,6 +66,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -75,6 +85,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -97,6 +108,7 @@ public function getUserIds(): ?array */ public function setUserIds(?array $userIds): self { + $this->initialized['userIds'] = true; $this->userIds = $userIds; return $this; @@ -115,6 +127,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -133,6 +146,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/Roles.php b/generated/Model/Roles.php index 138be9d..d3a101c 100644 --- a/generated/Model/Roles.php +++ b/generated/Model/Roles.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Roles +class Roles extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Role[] */ @@ -46,6 +50,11 @@ class Roles */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Role[] */ @@ -59,6 +68,7 @@ public function getRoles(): array */ public function setRoles(array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/RolesPostBody.php b/generated/Model/RolesPostBody.php index 38490f7..6eb3fab 100644 --- a/generated/Model/RolesPostBody.php +++ b/generated/Model/RolesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class RolesPostBody +class RolesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the role. * @@ -26,6 +30,11 @@ class RolesPostBody */ protected $userIds; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the role. */ @@ -39,6 +48,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -61,6 +71,7 @@ public function getUserIds(): ?array */ public function setUserIds(?array $userIds): self { + $this->initialized['userIds'] = true; $this->userIds = $userIds; return $this; diff --git a/generated/Model/RolesRoleIdPatchBody.php b/generated/Model/RolesRoleIdPatchBody.php index 05c608d..b543a9a 100644 --- a/generated/Model/RolesRoleIdPatchBody.php +++ b/generated/Model/RolesRoleIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class RolesRoleIdPatchBody +class RolesRoleIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the role. * @@ -26,6 +30,11 @@ class RolesRoleIdPatchBody */ protected $userIds; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the role. */ @@ -39,6 +48,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -61,6 +71,7 @@ public function getUserIds(): ?array */ public function setUserIds(?array $userIds): self { + $this->initialized['userIds'] = true; $this->userIds = $userIds; return $this; diff --git a/generated/Model/Task.php b/generated/Model/Task.php index 01f7dfd..3b9354a 100644 --- a/generated/Model/Task.php +++ b/generated/Model/Task.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Task +class Task extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the task. * @@ -62,6 +66,11 @@ class Task */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the task. */ @@ -75,6 +84,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -93,6 +103,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -111,6 +122,7 @@ public function getBillableByDefault(): ?bool */ public function setBillableByDefault(?bool $billableByDefault): self { + $this->initialized['billableByDefault'] = true; $this->billableByDefault = $billableByDefault; return $this; @@ -129,6 +141,7 @@ public function getDefaultHourlyRate(): ?float */ public function setDefaultHourlyRate(?float $defaultHourlyRate): self { + $this->initialized['defaultHourlyRate'] = true; $this->defaultHourlyRate = $defaultHourlyRate; return $this; @@ -147,6 +160,7 @@ public function getIsDefault(): ?bool */ public function setIsDefault(?bool $isDefault): self { + $this->initialized['isDefault'] = true; $this->isDefault = $isDefault; return $this; @@ -165,6 +179,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -183,6 +198,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -201,6 +217,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/TaskAssignment.php b/generated/Model/TaskAssignment.php index b9c56c3..2b66de8 100644 --- a/generated/Model/TaskAssignment.php +++ b/generated/Model/TaskAssignment.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TaskAssignment +class TaskAssignment extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the task assignment. * @@ -68,6 +72,11 @@ class TaskAssignment */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the task assignment. */ @@ -81,6 +90,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -99,6 +109,7 @@ public function getProject(): ?TaskAssignmentProject */ public function setProject(?TaskAssignmentProject $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; @@ -117,6 +128,7 @@ public function getTask(): ?TaskAssignmentTask */ public function setTask(?TaskAssignmentTask $task): self { + $this->initialized['task'] = true; $this->task = $task; return $this; @@ -135,6 +147,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -153,6 +166,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -171,6 +185,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -189,6 +204,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -207,6 +223,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -225,6 +242,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/TaskAssignmentProject.php b/generated/Model/TaskAssignmentProject.php index 74da9b3..6ebbbe4 100644 --- a/generated/Model/TaskAssignmentProject.php +++ b/generated/Model/TaskAssignmentProject.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TaskAssignmentProject +class TaskAssignmentProject extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class TaskAssignmentProject */ protected $code; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCode(): ?string public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; diff --git a/generated/Model/TaskAssignmentTask.php b/generated/Model/TaskAssignmentTask.php index 1cbd1ce..f0e6c57 100644 --- a/generated/Model/TaskAssignmentTask.php +++ b/generated/Model/TaskAssignmentTask.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TaskAssignmentTask +class TaskAssignmentTask extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class TaskAssignmentTask */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/TaskAssignments.php b/generated/Model/TaskAssignments.php index 129855c..53759c1 100644 --- a/generated/Model/TaskAssignments.php +++ b/generated/Model/TaskAssignments.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TaskAssignments +class TaskAssignments extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var TaskAssignment[] */ @@ -46,6 +50,11 @@ class TaskAssignments */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return TaskAssignment[] */ @@ -59,6 +68,7 @@ public function getTaskAssignments(): array */ public function setTaskAssignments(array $taskAssignments): self { + $this->initialized['taskAssignments'] = true; $this->taskAssignments = $taskAssignments; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/Tasks.php b/generated/Model/Tasks.php index f189d06..8340d9e 100644 --- a/generated/Model/Tasks.php +++ b/generated/Model/Tasks.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Tasks +class Tasks extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Task[] */ @@ -46,6 +50,11 @@ class Tasks */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Task[] */ @@ -59,6 +68,7 @@ public function getTasks(): array */ public function setTasks(array $tasks): self { + $this->initialized['tasks'] = true; $this->tasks = $tasks; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/TasksPostBody.php b/generated/Model/TasksPostBody.php index f7594b1..9bec7e6 100644 --- a/generated/Model/TasksPostBody.php +++ b/generated/Model/TasksPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TasksPostBody +class TasksPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the task. * @@ -44,6 +48,11 @@ class TasksPostBody */ protected $isActive; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the task. */ @@ -57,6 +66,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -75,6 +85,7 @@ public function getBillableByDefault(): ?bool */ public function setBillableByDefault(?bool $billableByDefault): self { + $this->initialized['billableByDefault'] = true; $this->billableByDefault = $billableByDefault; return $this; @@ -93,6 +104,7 @@ public function getDefaultHourlyRate(): ?float */ public function setDefaultHourlyRate(?float $defaultHourlyRate): self { + $this->initialized['defaultHourlyRate'] = true; $this->defaultHourlyRate = $defaultHourlyRate; return $this; @@ -111,6 +123,7 @@ public function getIsDefault(): ?bool */ public function setIsDefault(?bool $isDefault): self { + $this->initialized['isDefault'] = true; $this->isDefault = $isDefault; return $this; @@ -129,6 +142,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; diff --git a/generated/Model/TasksTaskIdPatchBody.php b/generated/Model/TasksTaskIdPatchBody.php index f415443..453c8f0 100644 --- a/generated/Model/TasksTaskIdPatchBody.php +++ b/generated/Model/TasksTaskIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TasksTaskIdPatchBody +class TasksTaskIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The name of the task. * @@ -44,6 +48,11 @@ class TasksTaskIdPatchBody */ protected $isActive; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The name of the task. */ @@ -57,6 +66,7 @@ public function getName(): ?string */ public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -75,6 +85,7 @@ public function getBillableByDefault(): ?bool */ public function setBillableByDefault(?bool $billableByDefault): self { + $this->initialized['billableByDefault'] = true; $this->billableByDefault = $billableByDefault; return $this; @@ -93,6 +104,7 @@ public function getDefaultHourlyRate(): ?float */ public function setDefaultHourlyRate(?float $defaultHourlyRate): self { + $this->initialized['defaultHourlyRate'] = true; $this->defaultHourlyRate = $defaultHourlyRate; return $this; @@ -111,6 +123,7 @@ public function getIsDefault(): ?bool */ public function setIsDefault(?bool $isDefault): self { + $this->initialized['isDefault'] = true; $this->isDefault = $isDefault; return $this; @@ -129,6 +142,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; diff --git a/generated/Model/Teammate.php b/generated/Model/Teammate.php index a14a0bd..7c453c6 100644 --- a/generated/Model/Teammate.php +++ b/generated/Model/Teammate.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Teammate +class Teammate extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the teammate. * @@ -38,6 +42,11 @@ class Teammate */ protected $email; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the teammate. * @@ -55,6 +64,7 @@ public function getId() */ public function setId($id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -73,6 +83,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -91,6 +102,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -109,6 +121,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; diff --git a/generated/Model/Teammates.php b/generated/Model/Teammates.php index d3840ae..baa9c3c 100644 --- a/generated/Model/Teammates.php +++ b/generated/Model/Teammates.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Teammates +class Teammates extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Teammate[] */ @@ -46,6 +50,11 @@ class Teammates */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Teammate[] */ @@ -59,6 +68,7 @@ public function getTeammates(): array */ public function setTeammates(array $teammates): self { + $this->initialized['teammates'] = true; $this->teammates = $teammates; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/TeammatesPatchResponse.php b/generated/Model/TeammatesPatchResponse.php index 9277bcf..5193128 100644 --- a/generated/Model/TeammatesPatchResponse.php +++ b/generated/Model/TeammatesPatchResponse.php @@ -11,13 +11,22 @@ namespace JoliCode\Harvest\Api\Model; -class TeammatesPatchResponse +class TeammatesPatchResponse extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var Teammate[] */ protected $teammates; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return Teammate[] */ @@ -31,6 +40,7 @@ public function getTeammates(): array */ public function setTeammates(array $teammates): self { + $this->initialized['teammates'] = true; $this->teammates = $teammates; return $this; diff --git a/generated/Model/TimeEntries.php b/generated/Model/TimeEntries.php index fcd3602..be5bdaf 100644 --- a/generated/Model/TimeEntries.php +++ b/generated/Model/TimeEntries.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntries +class TimeEntries extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var TimeEntry[] */ @@ -46,6 +50,11 @@ class TimeEntries */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return TimeEntry[] */ @@ -59,6 +68,7 @@ public function getTimeEntries(): array */ public function setTimeEntries(array $timeEntries): self { + $this->initialized['timeEntries'] = true; $this->timeEntries = $timeEntries; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/TimeEntriesPostBody.php b/generated/Model/TimeEntriesPostBody.php index dab6978..a47eee3 100644 --- a/generated/Model/TimeEntriesPostBody.php +++ b/generated/Model/TimeEntriesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntriesPostBody +class TimeEntriesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the user to associate with the time entry. Defaults to the currently authenticated user’s ID. * @@ -68,6 +72,11 @@ class TimeEntriesPostBody */ protected $hours; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the user to associate with the time entry. Defaults to the currently authenticated user’s ID. */ @@ -81,6 +90,7 @@ public function getUserId(): ?int */ public function setUserId(?int $userId): self { + $this->initialized['userId'] = true; $this->userId = $userId; return $this; @@ -99,6 +109,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -117,6 +128,7 @@ public function getTaskId(): ?int */ public function setTaskId(?int $taskId): self { + $this->initialized['taskId'] = true; $this->taskId = $taskId; return $this; @@ -135,6 +147,7 @@ public function getSpentDate(): ?\DateTime */ public function setSpentDate(?\DateTime $spentDate): self { + $this->initialized['spentDate'] = true; $this->spentDate = $spentDate; return $this; @@ -153,6 +166,7 @@ public function getStartedTime(): ?string */ public function setStartedTime(?string $startedTime): self { + $this->initialized['startedTime'] = true; $this->startedTime = $startedTime; return $this; @@ -171,6 +185,7 @@ public function getEndedTime(): ?string */ public function setEndedTime(?string $endedTime): self { + $this->initialized['endedTime'] = true; $this->endedTime = $endedTime; return $this; @@ -189,6 +204,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -207,6 +223,7 @@ public function getExternalReference(): ?TimeEntriesPostBodyExternalReference */ public function setExternalReference(?TimeEntriesPostBodyExternalReference $externalReference): self { + $this->initialized['externalReference'] = true; $this->externalReference = $externalReference; return $this; @@ -225,6 +242,7 @@ public function getHours(): ?float */ public function setHours(?float $hours): self { + $this->initialized['hours'] = true; $this->hours = $hours; return $this; diff --git a/generated/Model/TimeEntriesPostBodyExternalReference.php b/generated/Model/TimeEntriesPostBodyExternalReference.php index 5c462ca..e139b4f 100644 --- a/generated/Model/TimeEntriesPostBodyExternalReference.php +++ b/generated/Model/TimeEntriesPostBodyExternalReference.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntriesPostBodyExternalReference +class TimeEntriesPostBodyExternalReference extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -30,6 +34,11 @@ class TimeEntriesPostBodyExternalReference */ protected $permalink; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?string { return $this->id; @@ -37,6 +46,7 @@ public function getId(): ?string public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -49,6 +59,7 @@ public function getGroupId(): ?string public function setGroupId(?string $groupId): self { + $this->initialized['groupId'] = true; $this->groupId = $groupId; return $this; @@ -61,6 +72,7 @@ public function getAccountId(): ?string public function setAccountId(?string $accountId): self { + $this->initialized['accountId'] = true; $this->accountId = $accountId; return $this; @@ -73,6 +85,7 @@ public function getPermalink(): ?string public function setPermalink(?string $permalink): self { + $this->initialized['permalink'] = true; $this->permalink = $permalink; return $this; diff --git a/generated/Model/TimeEntriesTimeEntryIdPatchBody.php b/generated/Model/TimeEntriesTimeEntryIdPatchBody.php index f46c3e2..634ba1d 100644 --- a/generated/Model/TimeEntriesTimeEntryIdPatchBody.php +++ b/generated/Model/TimeEntriesTimeEntryIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntriesTimeEntryIdPatchBody +class TimeEntriesTimeEntryIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the project to associate with the time entry. * @@ -62,6 +66,11 @@ class TimeEntriesTimeEntryIdPatchBody */ protected $externalReference; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the project to associate with the time entry. */ @@ -75,6 +84,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -93,6 +103,7 @@ public function getTaskId(): ?int */ public function setTaskId(?int $taskId): self { + $this->initialized['taskId'] = true; $this->taskId = $taskId; return $this; @@ -111,6 +122,7 @@ public function getSpentDate(): ?\DateTime */ public function setSpentDate(?\DateTime $spentDate): self { + $this->initialized['spentDate'] = true; $this->spentDate = $spentDate; return $this; @@ -129,6 +141,7 @@ public function getStartedTime(): ?string */ public function setStartedTime(?string $startedTime): self { + $this->initialized['startedTime'] = true; $this->startedTime = $startedTime; return $this; @@ -147,6 +160,7 @@ public function getEndedTime(): ?string */ public function setEndedTime(?string $endedTime): self { + $this->initialized['endedTime'] = true; $this->endedTime = $endedTime; return $this; @@ -165,6 +179,7 @@ public function getHours(): ?float */ public function setHours(?float $hours): self { + $this->initialized['hours'] = true; $this->hours = $hours; return $this; @@ -183,6 +198,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -201,6 +217,7 @@ public function getExternalReference(): ?TimeEntriesTimeEntryIdPatchBodyExternal */ public function setExternalReference(?TimeEntriesTimeEntryIdPatchBodyExternalReference $externalReference): self { + $this->initialized['externalReference'] = true; $this->externalReference = $externalReference; return $this; diff --git a/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php b/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php index a876b4e..d52bd23 100644 --- a/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php +++ b/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntriesTimeEntryIdPatchBodyExternalReference +class TimeEntriesTimeEntryIdPatchBodyExternalReference extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -30,6 +34,11 @@ class TimeEntriesTimeEntryIdPatchBodyExternalReference */ protected $permalink; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?string { return $this->id; @@ -37,6 +46,7 @@ public function getId(): ?string public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -49,6 +59,7 @@ public function getGroupId(): ?string public function setGroupId(?string $groupId): self { + $this->initialized['groupId'] = true; $this->groupId = $groupId; return $this; @@ -61,6 +72,7 @@ public function getAccountId(): ?string public function setAccountId(?string $accountId): self { + $this->initialized['accountId'] = true; $this->accountId = $accountId; return $this; @@ -73,6 +85,7 @@ public function getPermalink(): ?string public function setPermalink(?string $permalink): self { + $this->initialized['permalink'] = true; $this->permalink = $permalink; return $this; diff --git a/generated/Model/TimeEntry.php b/generated/Model/TimeEntry.php index 3674f3f..31c75a1 100644 --- a/generated/Model/TimeEntry.php +++ b/generated/Model/TimeEntry.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntry +class TimeEntry extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the time entry. * @@ -178,6 +182,11 @@ class TimeEntry */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the time entry. */ @@ -191,6 +200,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -209,6 +219,7 @@ public function getSpentDate(): ?\DateTime */ public function setSpentDate(?\DateTime $spentDate): self { + $this->initialized['spentDate'] = true; $this->spentDate = $spentDate; return $this; @@ -227,6 +238,7 @@ public function getUser(): ?TimeEntryUser */ public function setUser(?TimeEntryUser $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -239,6 +251,7 @@ public function getUserAssignment(): UserAssignment public function setUserAssignment(UserAssignment $userAssignment): self { + $this->initialized['userAssignment'] = true; $this->userAssignment = $userAssignment; return $this; @@ -257,6 +270,7 @@ public function getClient(): ?TimeEntryClient */ public function setClient(?TimeEntryClient $client): self { + $this->initialized['client'] = true; $this->client = $client; return $this; @@ -275,6 +289,7 @@ public function getProject(): ?TimeEntryProject */ public function setProject(?TimeEntryProject $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; @@ -293,6 +308,7 @@ public function getTask(): ?TimeEntryTask */ public function setTask(?TimeEntryTask $task): self { + $this->initialized['task'] = true; $this->task = $task; return $this; @@ -305,6 +321,7 @@ public function getTaskAssignment(): TaskAssignment public function setTaskAssignment(TaskAssignment $taskAssignment): self { + $this->initialized['taskAssignment'] = true; $this->taskAssignment = $taskAssignment; return $this; @@ -323,6 +340,7 @@ public function getExternalReference(): ?TimeEntryExternalReference */ public function setExternalReference(?TimeEntryExternalReference $externalReference): self { + $this->initialized['externalReference'] = true; $this->externalReference = $externalReference; return $this; @@ -341,6 +359,7 @@ public function getInvoice(): ?TimeEntryInvoice */ public function setInvoice(?TimeEntryInvoice $invoice): self { + $this->initialized['invoice'] = true; $this->invoice = $invoice; return $this; @@ -359,6 +378,7 @@ public function getHours(): ?float */ public function setHours(?float $hours): self { + $this->initialized['hours'] = true; $this->hours = $hours; return $this; @@ -377,6 +397,7 @@ public function getHoursWithoutTimer(): ?float */ public function setHoursWithoutTimer(?float $hoursWithoutTimer): self { + $this->initialized['hoursWithoutTimer'] = true; $this->hoursWithoutTimer = $hoursWithoutTimer; return $this; @@ -395,6 +416,7 @@ public function getRoundedHours(): ?float */ public function setRoundedHours(?float $roundedHours): self { + $this->initialized['roundedHours'] = true; $this->roundedHours = $roundedHours; return $this; @@ -413,6 +435,7 @@ public function getNotes(): ?string */ public function setNotes(?string $notes): self { + $this->initialized['notes'] = true; $this->notes = $notes; return $this; @@ -431,6 +454,7 @@ public function getIsLocked(): ?bool */ public function setIsLocked(?bool $isLocked): self { + $this->initialized['isLocked'] = true; $this->isLocked = $isLocked; return $this; @@ -449,6 +473,7 @@ public function getLockedReason(): ?string */ public function setLockedReason(?string $lockedReason): self { + $this->initialized['lockedReason'] = true; $this->lockedReason = $lockedReason; return $this; @@ -467,6 +492,7 @@ public function getIsClosed(): ?bool */ public function setIsClosed(?bool $isClosed): self { + $this->initialized['isClosed'] = true; $this->isClosed = $isClosed; return $this; @@ -485,6 +511,7 @@ public function getIsBilled(): ?bool */ public function setIsBilled(?bool $isBilled): self { + $this->initialized['isBilled'] = true; $this->isBilled = $isBilled; return $this; @@ -503,6 +530,7 @@ public function getTimerStartedAt(): ?\DateTime */ public function setTimerStartedAt(?\DateTime $timerStartedAt): self { + $this->initialized['timerStartedAt'] = true; $this->timerStartedAt = $timerStartedAt; return $this; @@ -521,6 +549,7 @@ public function getStartedTime(): ?string */ public function setStartedTime(?string $startedTime): self { + $this->initialized['startedTime'] = true; $this->startedTime = $startedTime; return $this; @@ -539,6 +568,7 @@ public function getEndedTime(): ?string */ public function setEndedTime(?string $endedTime): self { + $this->initialized['endedTime'] = true; $this->endedTime = $endedTime; return $this; @@ -557,6 +587,7 @@ public function getIsRunning(): ?bool */ public function setIsRunning(?bool $isRunning): self { + $this->initialized['isRunning'] = true; $this->isRunning = $isRunning; return $this; @@ -575,6 +606,7 @@ public function getBillable(): ?bool */ public function setBillable(?bool $billable): self { + $this->initialized['billable'] = true; $this->billable = $billable; return $this; @@ -593,6 +625,7 @@ public function getBudgeted(): ?bool */ public function setBudgeted(?bool $budgeted): self { + $this->initialized['budgeted'] = true; $this->budgeted = $budgeted; return $this; @@ -611,6 +644,7 @@ public function getBillableRate(): ?float */ public function setBillableRate(?float $billableRate): self { + $this->initialized['billableRate'] = true; $this->billableRate = $billableRate; return $this; @@ -629,6 +663,7 @@ public function getCostRate(): ?float */ public function setCostRate(?float $costRate): self { + $this->initialized['costRate'] = true; $this->costRate = $costRate; return $this; @@ -647,6 +682,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -665,6 +701,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/TimeEntryClient.php b/generated/Model/TimeEntryClient.php index 01b64ab..8aabbe8 100644 --- a/generated/Model/TimeEntryClient.php +++ b/generated/Model/TimeEntryClient.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntryClient +class TimeEntryClient extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class TimeEntryClient */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/TimeEntryExternalReference.php b/generated/Model/TimeEntryExternalReference.php index 63eda98..b7613cf 100644 --- a/generated/Model/TimeEntryExternalReference.php +++ b/generated/Model/TimeEntryExternalReference.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntryExternalReference +class TimeEntryExternalReference extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var string|null */ @@ -38,6 +42,11 @@ class TimeEntryExternalReference */ protected $serviceIconUrl; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?string { return $this->id; @@ -45,6 +54,7 @@ public function getId(): ?string public function setId(?string $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -57,6 +67,7 @@ public function getGroupId(): ?string public function setGroupId(?string $groupId): self { + $this->initialized['groupId'] = true; $this->groupId = $groupId; return $this; @@ -69,6 +80,7 @@ public function getAccountId(): ?string public function setAccountId(?string $accountId): self { + $this->initialized['accountId'] = true; $this->accountId = $accountId; return $this; @@ -81,6 +93,7 @@ public function getPermalink(): ?string public function setPermalink(?string $permalink): self { + $this->initialized['permalink'] = true; $this->permalink = $permalink; return $this; @@ -93,6 +106,7 @@ public function getService(): ?string public function setService(?string $service): self { + $this->initialized['service'] = true; $this->service = $service; return $this; @@ -105,6 +119,7 @@ public function getServiceIconUrl(): ?string public function setServiceIconUrl(?string $serviceIconUrl): self { + $this->initialized['serviceIconUrl'] = true; $this->serviceIconUrl = $serviceIconUrl; return $this; diff --git a/generated/Model/TimeEntryInvoice.php b/generated/Model/TimeEntryInvoice.php index 88fefda..afc5158 100644 --- a/generated/Model/TimeEntryInvoice.php +++ b/generated/Model/TimeEntryInvoice.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntryInvoice +class TimeEntryInvoice extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class TimeEntryInvoice */ protected $number; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getNumber(): ?string public function setNumber(?string $number): self { + $this->initialized['number'] = true; $this->number = $number; return $this; diff --git a/generated/Model/TimeEntryProject.php b/generated/Model/TimeEntryProject.php index 97a3912..5b60574 100644 --- a/generated/Model/TimeEntryProject.php +++ b/generated/Model/TimeEntryProject.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntryProject +class TimeEntryProject extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class TimeEntryProject */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/TimeEntryTask.php b/generated/Model/TimeEntryTask.php index e31adee..9db14dd 100644 --- a/generated/Model/TimeEntryTask.php +++ b/generated/Model/TimeEntryTask.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntryTask +class TimeEntryTask extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class TimeEntryTask */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/TimeEntryUser.php b/generated/Model/TimeEntryUser.php index 114dc1b..6bd2dff 100644 --- a/generated/Model/TimeEntryUser.php +++ b/generated/Model/TimeEntryUser.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeEntryUser +class TimeEntryUser extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class TimeEntryUser */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/TimeReportsResult.php b/generated/Model/TimeReportsResult.php index 92b81fc..75e5f29 100644 --- a/generated/Model/TimeReportsResult.php +++ b/generated/Model/TimeReportsResult.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeReportsResult +class TimeReportsResult extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client associated with the reported hours. Only returned in the Client and Project reports. * @@ -61,6 +65,18 @@ class TimeReportsResult * @var string|null */ protected $userName; + /** + * The number of hours per week this person is available to work in seconds, in half hour increments. For example, if a person’s capacity is 35 hours, the API will return 126000 seconds. Only returned in the Team report. + * + * @var int|null + */ + protected $weeklyCapacity; + /** + * The URL to the user’s avatar image. Only returned in the Team report. + * + * @var string|null + */ + protected $avatarUrl; /** * The contractor status of the user associated with the reported hours. Only returned in the Team report. * @@ -92,6 +108,11 @@ class TimeReportsResult */ protected $billableAmount; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client associated with the reported hours. Only returned in the Client and Project reports. */ @@ -105,6 +126,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -123,6 +145,7 @@ public function getClientName(): ?string */ public function setClientName(?string $clientName): self { + $this->initialized['clientName'] = true; $this->clientName = $clientName; return $this; @@ -141,6 +164,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -159,6 +183,7 @@ public function getProjectName(): ?string */ public function setProjectName(?string $projectName): self { + $this->initialized['projectName'] = true; $this->projectName = $projectName; return $this; @@ -177,6 +202,7 @@ public function getTaskId(): ?int */ public function setTaskId(?int $taskId): self { + $this->initialized['taskId'] = true; $this->taskId = $taskId; return $this; @@ -195,6 +221,7 @@ public function getTaskName(): ?string */ public function setTaskName(?string $taskName): self { + $this->initialized['taskName'] = true; $this->taskName = $taskName; return $this; @@ -213,6 +240,7 @@ public function getUserId(): ?int */ public function setUserId(?int $userId): self { + $this->initialized['userId'] = true; $this->userId = $userId; return $this; @@ -231,11 +259,50 @@ public function getUserName(): ?string */ public function setUserName(?string $userName): self { + $this->initialized['userName'] = true; $this->userName = $userName; return $this; } + /** + * The number of hours per week this person is available to work in seconds, in half hour increments. For example, if a person’s capacity is 35 hours, the API will return 126000 seconds. Only returned in the Team report. + */ + public function getWeeklyCapacity(): ?int + { + return $this->weeklyCapacity; + } + + /** + * The number of hours per week this person is available to work in seconds, in half hour increments. For example, if a person’s capacity is 35 hours, the API will return 126000 seconds. Only returned in the Team report. + */ + public function setWeeklyCapacity(?int $weeklyCapacity): self + { + $this->initialized['weeklyCapacity'] = true; + $this->weeklyCapacity = $weeklyCapacity; + + return $this; + } + + /** + * The URL to the user’s avatar image. Only returned in the Team report. + */ + public function getAvatarUrl(): ?string + { + return $this->avatarUrl; + } + + /** + * The URL to the user’s avatar image. Only returned in the Team report. + */ + public function setAvatarUrl(?string $avatarUrl): self + { + $this->initialized['avatarUrl'] = true; + $this->avatarUrl = $avatarUrl; + + return $this; + } + /** * The contractor status of the user associated with the reported hours. Only returned in the Team report. */ @@ -249,6 +316,7 @@ public function getIsContractor(): ?bool */ public function setIsContractor(?bool $isContractor): self { + $this->initialized['isContractor'] = true; $this->isContractor = $isContractor; return $this; @@ -267,6 +335,7 @@ public function getTotalHours(): ?float */ public function setTotalHours(?float $totalHours): self { + $this->initialized['totalHours'] = true; $this->totalHours = $totalHours; return $this; @@ -285,6 +354,7 @@ public function getBillableHours(): ?float */ public function setBillableHours(?float $billableHours): self { + $this->initialized['billableHours'] = true; $this->billableHours = $billableHours; return $this; @@ -303,6 +373,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -321,6 +392,7 @@ public function getBillableAmount(): ?float */ public function setBillableAmount(?float $billableAmount): self { + $this->initialized['billableAmount'] = true; $this->billableAmount = $billableAmount; return $this; diff --git a/generated/Model/TimeReportsResults.php b/generated/Model/TimeReportsResults.php index 8163abc..2c656d6 100644 --- a/generated/Model/TimeReportsResults.php +++ b/generated/Model/TimeReportsResults.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class TimeReportsResults +class TimeReportsResults extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var TimeReportsResult[] */ @@ -46,6 +50,11 @@ class TimeReportsResults */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return TimeReportsResult[] */ @@ -59,6 +68,7 @@ public function getResults(): array */ public function setResults(array $results): self { + $this->initialized['results'] = true; $this->results = $results; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/UninvoicedReportResult.php b/generated/Model/UninvoicedReportResult.php index de9354a..2683166 100644 --- a/generated/Model/UninvoicedReportResult.php +++ b/generated/Model/UninvoicedReportResult.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UninvoicedReportResult +class UninvoicedReportResult extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The ID of the client associated with the reported hours and expenses. * @@ -68,6 +72,11 @@ class UninvoicedReportResult */ protected $uninvoicedAmount; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The ID of the client associated with the reported hours and expenses. */ @@ -81,6 +90,7 @@ public function getClientId(): ?int */ public function setClientId(?int $clientId): self { + $this->initialized['clientId'] = true; $this->clientId = $clientId; return $this; @@ -99,6 +109,7 @@ public function getClientName(): ?string */ public function setClientName(?string $clientName): self { + $this->initialized['clientName'] = true; $this->clientName = $clientName; return $this; @@ -117,6 +128,7 @@ public function getProjectId(): ?int */ public function setProjectId(?int $projectId): self { + $this->initialized['projectId'] = true; $this->projectId = $projectId; return $this; @@ -135,6 +147,7 @@ public function getProjectName(): ?string */ public function setProjectName(?string $projectName): self { + $this->initialized['projectName'] = true; $this->projectName = $projectName; return $this; @@ -153,6 +166,7 @@ public function getCurrency(): ?string */ public function setCurrency(?string $currency): self { + $this->initialized['currency'] = true; $this->currency = $currency; return $this; @@ -171,6 +185,7 @@ public function getTotalHours(): ?float */ public function setTotalHours(?float $totalHours): self { + $this->initialized['totalHours'] = true; $this->totalHours = $totalHours; return $this; @@ -189,6 +204,7 @@ public function getUninvoicedHours(): ?float */ public function setUninvoicedHours(?float $uninvoicedHours): self { + $this->initialized['uninvoicedHours'] = true; $this->uninvoicedHours = $uninvoicedHours; return $this; @@ -207,6 +223,7 @@ public function getUninvoicedExpenses(): ?float */ public function setUninvoicedExpenses(?float $uninvoicedExpenses): self { + $this->initialized['uninvoicedExpenses'] = true; $this->uninvoicedExpenses = $uninvoicedExpenses; return $this; @@ -225,6 +242,7 @@ public function getUninvoicedAmount(): ?float */ public function setUninvoicedAmount(?float $uninvoicedAmount): self { + $this->initialized['uninvoicedAmount'] = true; $this->uninvoicedAmount = $uninvoicedAmount; return $this; diff --git a/generated/Model/UninvoicedReportResults.php b/generated/Model/UninvoicedReportResults.php index 6fd6961..670b1e6 100644 --- a/generated/Model/UninvoicedReportResults.php +++ b/generated/Model/UninvoicedReportResults.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UninvoicedReportResults +class UninvoicedReportResults extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var UninvoicedReportResult[] */ @@ -46,6 +50,11 @@ class UninvoicedReportResults */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return UninvoicedReportResult[] */ @@ -59,6 +68,7 @@ public function getResults(): array */ public function setResults(array $results): self { + $this->initialized['results'] = true; $this->results = $results; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/User.php b/generated/Model/User.php index 76dc29d..26dca03 100644 --- a/generated/Model/User.php +++ b/generated/Model/User.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class User +class User extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the user. * @@ -116,6 +120,11 @@ class User */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the user. */ @@ -129,6 +138,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -147,6 +157,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -165,6 +176,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -183,6 +195,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -201,6 +214,7 @@ public function getTelephone(): ?string */ public function setTelephone(?string $telephone): self { + $this->initialized['telephone'] = true; $this->telephone = $telephone; return $this; @@ -219,6 +233,7 @@ public function getTimezone(): ?string */ public function setTimezone(?string $timezone): self { + $this->initialized['timezone'] = true; $this->timezone = $timezone; return $this; @@ -237,6 +252,7 @@ public function getHasAccessToAllFutureProjects(): ?bool */ public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self { + $this->initialized['hasAccessToAllFutureProjects'] = true; $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects; return $this; @@ -255,6 +271,7 @@ public function getIsContractor(): ?bool */ public function setIsContractor(?bool $isContractor): self { + $this->initialized['isContractor'] = true; $this->isContractor = $isContractor; return $this; @@ -273,6 +290,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -291,6 +309,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; @@ -309,6 +328,7 @@ public function getDefaultHourlyRate(): ?float */ public function setDefaultHourlyRate(?float $defaultHourlyRate): self { + $this->initialized['defaultHourlyRate'] = true; $this->defaultHourlyRate = $defaultHourlyRate; return $this; @@ -327,6 +347,7 @@ public function getCostRate(): ?float */ public function setCostRate(?float $costRate): self { + $this->initialized['costRate'] = true; $this->costRate = $costRate; return $this; @@ -349,6 +370,7 @@ public function getRoles(): ?array */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; @@ -371,6 +393,7 @@ public function getAccessRoles(): ?array */ public function setAccessRoles(?array $accessRoles): self { + $this->initialized['accessRoles'] = true; $this->accessRoles = $accessRoles; return $this; @@ -389,6 +412,7 @@ public function getAvatarUrl(): ?string */ public function setAvatarUrl(?string $avatarUrl): self { + $this->initialized['avatarUrl'] = true; $this->avatarUrl = $avatarUrl; return $this; @@ -407,6 +431,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -425,6 +450,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/UserAssignment.php b/generated/Model/UserAssignment.php index 7b6d6cb..2e38752 100644 --- a/generated/Model/UserAssignment.php +++ b/generated/Model/UserAssignment.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UserAssignment +class UserAssignment extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Unique ID for the user assignment. * @@ -74,6 +78,11 @@ class UserAssignment */ protected $updatedAt; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Unique ID for the user assignment. */ @@ -87,6 +96,7 @@ public function getId(): ?int */ public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -105,6 +115,7 @@ public function getProject(): ?UserAssignmentProject */ public function setProject(?UserAssignmentProject $project): self { + $this->initialized['project'] = true; $this->project = $project; return $this; @@ -123,6 +134,7 @@ public function getUser(): ?UserAssignmentUser */ public function setUser(?UserAssignmentUser $user): self { + $this->initialized['user'] = true; $this->user = $user; return $this; @@ -141,6 +153,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -159,6 +172,7 @@ public function getIsProjectManager(): ?bool */ public function setIsProjectManager(?bool $isProjectManager): self { + $this->initialized['isProjectManager'] = true; $this->isProjectManager = $isProjectManager; return $this; @@ -177,6 +191,7 @@ public function getUseDefaultRates(): ?bool */ public function setUseDefaultRates(?bool $useDefaultRates): self { + $this->initialized['useDefaultRates'] = true; $this->useDefaultRates = $useDefaultRates; return $this; @@ -195,6 +210,7 @@ public function getHourlyRate(): ?float */ public function setHourlyRate(?float $hourlyRate): self { + $this->initialized['hourlyRate'] = true; $this->hourlyRate = $hourlyRate; return $this; @@ -213,6 +229,7 @@ public function getBudget(): ?float */ public function setBudget(?float $budget): self { + $this->initialized['budget'] = true; $this->budget = $budget; return $this; @@ -231,6 +248,7 @@ public function getCreatedAt(): ?\DateTime */ public function setCreatedAt(?\DateTime $createdAt): self { + $this->initialized['createdAt'] = true; $this->createdAt = $createdAt; return $this; @@ -249,6 +267,7 @@ public function getUpdatedAt(): ?\DateTime */ public function setUpdatedAt(?\DateTime $updatedAt): self { + $this->initialized['updatedAt'] = true; $this->updatedAt = $updatedAt; return $this; diff --git a/generated/Model/UserAssignmentProject.php b/generated/Model/UserAssignmentProject.php index b1bc798..8fa2375 100644 --- a/generated/Model/UserAssignmentProject.php +++ b/generated/Model/UserAssignmentProject.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UserAssignmentProject +class UserAssignmentProject extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -26,6 +30,11 @@ class UserAssignmentProject */ protected $code; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -33,6 +42,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -45,6 +55,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; @@ -57,6 +68,7 @@ public function getCode(): ?string public function setCode(?string $code): self { + $this->initialized['code'] = true; $this->code = $code; return $this; diff --git a/generated/Model/UserAssignmentUser.php b/generated/Model/UserAssignmentUser.php index 51e0209..eefea9b 100644 --- a/generated/Model/UserAssignmentUser.php +++ b/generated/Model/UserAssignmentUser.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UserAssignmentUser +class UserAssignmentUser extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var int|null */ @@ -22,6 +26,11 @@ class UserAssignmentUser */ protected $name; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + public function getId(): ?int { return $this->id; @@ -29,6 +38,7 @@ public function getId(): ?int public function setId(?int $id): self { + $this->initialized['id'] = true; $this->id = $id; return $this; @@ -41,6 +51,7 @@ public function getName(): ?string public function setName(?string $name): self { + $this->initialized['name'] = true; $this->name = $name; return $this; diff --git a/generated/Model/UserAssignments.php b/generated/Model/UserAssignments.php index 03c2e69..2ce7f60 100644 --- a/generated/Model/UserAssignments.php +++ b/generated/Model/UserAssignments.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UserAssignments +class UserAssignments extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var UserAssignment[] */ @@ -46,6 +50,11 @@ class UserAssignments */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return UserAssignment[] */ @@ -59,6 +68,7 @@ public function getUserAssignments(): array */ public function setUserAssignments(array $userAssignments): self { + $this->initialized['userAssignments'] = true; $this->userAssignments = $userAssignments; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/Users.php b/generated/Model/Users.php index d6de933..1cd325b 100644 --- a/generated/Model/Users.php +++ b/generated/Model/Users.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class Users +class Users extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * @var User[] */ @@ -46,6 +50,11 @@ class Users */ protected $links; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * @return User[] */ @@ -59,6 +68,7 @@ public function getUsers(): array */ public function setUsers(array $users): self { + $this->initialized['users'] = true; $this->users = $users; return $this; @@ -71,6 +81,7 @@ public function getPerPage(): int public function setPerPage(int $perPage): self { + $this->initialized['perPage'] = true; $this->perPage = $perPage; return $this; @@ -83,6 +94,7 @@ public function getTotalPages(): int public function setTotalPages(int $totalPages): self { + $this->initialized['totalPages'] = true; $this->totalPages = $totalPages; return $this; @@ -95,6 +107,7 @@ public function getTotalEntries(): int public function setTotalEntries(int $totalEntries): self { + $this->initialized['totalEntries'] = true; $this->totalEntries = $totalEntries; return $this; @@ -107,6 +120,7 @@ public function getNextPage(): ?int public function setNextPage(?int $nextPage): self { + $this->initialized['nextPage'] = true; $this->nextPage = $nextPage; return $this; @@ -119,6 +133,7 @@ public function getPreviousPage(): ?int public function setPreviousPage(?int $previousPage): self { + $this->initialized['previousPage'] = true; $this->previousPage = $previousPage; return $this; @@ -131,6 +146,7 @@ public function getPage(): int public function setPage(int $page): self { + $this->initialized['page'] = true; $this->page = $page; return $this; @@ -143,6 +159,7 @@ public function getLinks(): PaginationLinks public function setLinks(PaginationLinks $links): self { + $this->initialized['links'] = true; $this->links = $links; return $this; diff --git a/generated/Model/UsersPostBody.php b/generated/Model/UsersPostBody.php index b1082ec..bdaf9d4 100644 --- a/generated/Model/UsersPostBody.php +++ b/generated/Model/UsersPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UsersPostBody +class UsersPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The first name of the user. * @@ -86,6 +90,11 @@ class UsersPostBody */ protected $accessRoles; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The first name of the user. */ @@ -99,6 +108,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -117,6 +127,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -135,6 +146,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -153,6 +165,7 @@ public function getTimezone(): ?string */ public function setTimezone(?string $timezone): self { + $this->initialized['timezone'] = true; $this->timezone = $timezone; return $this; @@ -171,6 +184,7 @@ public function getHasAccessToAllFutureProjects(): ?bool */ public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self { + $this->initialized['hasAccessToAllFutureProjects'] = true; $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects; return $this; @@ -189,6 +203,7 @@ public function getIsContractor(): ?bool */ public function setIsContractor(?bool $isContractor): self { + $this->initialized['isContractor'] = true; $this->isContractor = $isContractor; return $this; @@ -207,6 +222,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -225,6 +241,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; @@ -243,6 +260,7 @@ public function getDefaultHourlyRate(): ?float */ public function setDefaultHourlyRate(?float $defaultHourlyRate): self { + $this->initialized['defaultHourlyRate'] = true; $this->defaultHourlyRate = $defaultHourlyRate; return $this; @@ -261,6 +279,7 @@ public function getCostRate(): ?float */ public function setCostRate(?float $costRate): self { + $this->initialized['costRate'] = true; $this->costRate = $costRate; return $this; @@ -283,6 +302,7 @@ public function getRoles(): ?array */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; @@ -305,6 +325,7 @@ public function getAccessRoles(): ?array */ public function setAccessRoles(?array $accessRoles): self { + $this->initialized['accessRoles'] = true; $this->accessRoles = $accessRoles; return $this; diff --git a/generated/Model/UsersUserIdBillableRatesPostBody.php b/generated/Model/UsersUserIdBillableRatesPostBody.php index d398d14..071eb16 100644 --- a/generated/Model/UsersUserIdBillableRatesPostBody.php +++ b/generated/Model/UsersUserIdBillableRatesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UsersUserIdBillableRatesPostBody +class UsersUserIdBillableRatesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The amount of the billable rate. * @@ -26,6 +30,11 @@ class UsersUserIdBillableRatesPostBody */ protected $startDate; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The amount of the billable rate. */ @@ -39,6 +48,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -57,6 +67,7 @@ public function getStartDate(): ?\DateTime */ public function setStartDate(?\DateTime $startDate): self { + $this->initialized['startDate'] = true; $this->startDate = $startDate; return $this; diff --git a/generated/Model/UsersUserIdCostRatesPostBody.php b/generated/Model/UsersUserIdCostRatesPostBody.php index 14afce8..ab33008 100644 --- a/generated/Model/UsersUserIdCostRatesPostBody.php +++ b/generated/Model/UsersUserIdCostRatesPostBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UsersUserIdCostRatesPostBody +class UsersUserIdCostRatesPostBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The amount of the cost rate. * @@ -26,6 +30,11 @@ class UsersUserIdCostRatesPostBody */ protected $startDate; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The amount of the cost rate. */ @@ -39,6 +48,7 @@ public function getAmount(): ?float */ public function setAmount(?float $amount): self { + $this->initialized['amount'] = true; $this->amount = $amount; return $this; @@ -57,6 +67,7 @@ public function getStartDate(): ?\DateTime */ public function setStartDate(?\DateTime $startDate): self { + $this->initialized['startDate'] = true; $this->startDate = $startDate; return $this; diff --git a/generated/Model/UsersUserIdPatchBody.php b/generated/Model/UsersUserIdPatchBody.php index 1b587e6..25ded76 100644 --- a/generated/Model/UsersUserIdPatchBody.php +++ b/generated/Model/UsersUserIdPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UsersUserIdPatchBody +class UsersUserIdPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * The first name of the user. Can’t be updated if the user is inactive. * @@ -86,6 +90,11 @@ class UsersUserIdPatchBody */ protected $accessRoles; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * The first name of the user. Can’t be updated if the user is inactive. */ @@ -99,6 +108,7 @@ public function getFirstName(): ?string */ public function setFirstName(?string $firstName): self { + $this->initialized['firstName'] = true; $this->firstName = $firstName; return $this; @@ -117,6 +127,7 @@ public function getLastName(): ?string */ public function setLastName(?string $lastName): self { + $this->initialized['lastName'] = true; $this->lastName = $lastName; return $this; @@ -135,6 +146,7 @@ public function getEmail(): ?string */ public function setEmail(?string $email): self { + $this->initialized['email'] = true; $this->email = $email; return $this; @@ -153,6 +165,7 @@ public function getTimezone(): ?string */ public function setTimezone(?string $timezone): self { + $this->initialized['timezone'] = true; $this->timezone = $timezone; return $this; @@ -171,6 +184,7 @@ public function getHasAccessToAllFutureProjects(): ?bool */ public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self { + $this->initialized['hasAccessToAllFutureProjects'] = true; $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects; return $this; @@ -189,6 +203,7 @@ public function getIsContractor(): ?bool */ public function setIsContractor(?bool $isContractor): self { + $this->initialized['isContractor'] = true; $this->isContractor = $isContractor; return $this; @@ -207,6 +222,7 @@ public function getIsActive(): ?bool */ public function setIsActive(?bool $isActive): self { + $this->initialized['isActive'] = true; $this->isActive = $isActive; return $this; @@ -225,6 +241,7 @@ public function getWeeklyCapacity(): ?int */ public function setWeeklyCapacity(?int $weeklyCapacity): self { + $this->initialized['weeklyCapacity'] = true; $this->weeklyCapacity = $weeklyCapacity; return $this; @@ -243,6 +260,7 @@ public function getDefaultHourlyRate(): ?float */ public function setDefaultHourlyRate(?float $defaultHourlyRate): self { + $this->initialized['defaultHourlyRate'] = true; $this->defaultHourlyRate = $defaultHourlyRate; return $this; @@ -261,6 +279,7 @@ public function getCostRate(): ?float */ public function setCostRate(?float $costRate): self { + $this->initialized['costRate'] = true; $this->costRate = $costRate; return $this; @@ -283,6 +302,7 @@ public function getRoles(): ?array */ public function setRoles(?array $roles): self { + $this->initialized['roles'] = true; $this->roles = $roles; return $this; @@ -305,6 +325,7 @@ public function getAccessRoles(): ?array */ public function setAccessRoles(?array $accessRoles): self { + $this->initialized['accessRoles'] = true; $this->accessRoles = $accessRoles; return $this; diff --git a/generated/Model/UsersUserIdTeammatesPatchBody.php b/generated/Model/UsersUserIdTeammatesPatchBody.php index 1701981..c5bcb1e 100644 --- a/generated/Model/UsersUserIdTeammatesPatchBody.php +++ b/generated/Model/UsersUserIdTeammatesPatchBody.php @@ -11,8 +11,12 @@ namespace JoliCode\Harvest\Api\Model; -class UsersUserIdTeammatesPatchBody +class UsersUserIdTeammatesPatchBody extends \ArrayObject { + /** + * @var array + */ + protected $initialized = []; /** * Full list of user IDs to be assigned to the Manager. * @@ -20,6 +24,11 @@ class UsersUserIdTeammatesPatchBody */ protected $teammateIds; + public function isInitialized($property): bool + { + return \array_key_exists($property, $this->initialized); + } + /** * Full list of user IDs to be assigned to the Manager. * @@ -37,6 +46,7 @@ public function getTeammateIds() */ public function setTeammateIds($teammateIds): self { + $this->initialized['teammateIds'] = true; $this->teammateIds = $teammateIds; return $this; diff --git a/generated/Normalizer/BillableRateNormalizer.php b/generated/Normalizer/BillableRateNormalizer.php index 6b985cb..af58760 100644 --- a/generated/Normalizer/BillableRateNormalizer.php +++ b/generated/Normalizer/BillableRateNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class BillableRateNormalizer implements DenormalizerInterface, NormalizerInterfa use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\BillableRate' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\BillableRate' === \get_class($data); } @@ -52,39 +54,53 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\BillableRate(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); + unset($data['end_date']); } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { $object->setEndDate(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -98,24 +114,29 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getStartDate()) { + if ($object->isInitialized('startDate') && null !== $object->getStartDate()) { $data['start_date'] = $object->getStartDate()->format('Y-m-d'); } - if (null !== $object->getEndDate()) { + if ($object->isInitialized('endDate') && null !== $object->getEndDate()) { $data['end_date'] = $object->getEndDate()->format('Y-m-d'); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/BillableRatesNormalizer.php b/generated/Normalizer/BillableRatesNormalizer.php index 10ca98f..2b0008a 100644 --- a/generated/Normalizer/BillableRatesNormalizer.php +++ b/generated/Normalizer/BillableRatesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class BillableRatesNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\BillableRates' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\BillableRates' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json', $context); } $object->setBillableRates($values); + unset($data['billable_rates']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ClientNormalizer.php b/generated/Normalizer/ClientNormalizer.php index cf51d8d..6b4ccba 100644 --- a/generated/Normalizer/ClientNormalizer.php +++ b/generated/Normalizer/ClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ClientNormalizer implements DenormalizerInterface, NormalizerInterface, De use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Client' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Client' === \get_class($data); } @@ -57,44 +59,57 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('address', $data) && null !== $data['address']) { $object->setAddress($data['address']); + unset($data['address']); } elseif (\array_key_exists('address', $data) && null === $data['address']) { $object->setAddress(null); } if (\array_key_exists('statement_key', $data) && null !== $data['statement_key']) { $object->setStatementKey($data['statement_key']); + unset($data['statement_key']); } elseif (\array_key_exists('statement_key', $data) && null === $data['statement_key']) { $object->setStatementKey(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -108,30 +123,35 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getAddress()) { + if ($object->isInitialized('address') && null !== $object->getAddress()) { $data['address'] = $object->getAddress(); } - if (null !== $object->getStatementKey()) { + if ($object->isInitialized('statementKey') && null !== $object->getStatementKey()) { $data['statement_key'] = $object->getStatementKey(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php b/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php index a728d97..43531f4 100644 --- a/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ClientsClientIdPatchBodyNormalizer implements DenormalizerInterface, Norma use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('address', $data) && null !== $data['address']) { $object->setAddress($data['address']); + unset($data['address']); } elseif (\array_key_exists('address', $data) && null === $data['address']) { $object->setAddress(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getAddress()) { + if ($object->isInitialized('address') && null !== $object->getAddress()) { $data['address'] = $object->getAddress(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ClientsNormalizer.php b/generated/Normalizer/ClientsNormalizer.php index e7b0e38..f1623cf 100644 --- a/generated/Normalizer/ClientsNormalizer.php +++ b/generated/Normalizer/ClientsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ClientsNormalizer implements DenormalizerInterface, NormalizerInterface, D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Clients' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Clients' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json', $context); } $object->setClients($values); + unset($data['clients']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ClientsPostBodyNormalizer.php b/generated/Normalizer/ClientsPostBodyNormalizer.php index 4a13ec8..b2a59d5 100644 --- a/generated/Normalizer/ClientsPostBodyNormalizer.php +++ b/generated/Normalizer/ClientsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ClientsPostBodyNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('address', $data) && null !== $data['address']) { $object->setAddress($data['address']); + unset($data['address']); } elseif (\array_key_exists('address', $data) && null === $data['address']) { $object->setAddress(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -89,15 +100,20 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['name'] = $object->getName(); - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getAddress()) { + if ($object->isInitialized('address') && null !== $object->getAddress()) { $data['address'] = $object->getAddress(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/CompaniesNormalizer.php b/generated/Normalizer/CompaniesNormalizer.php index 63133b7..12b946b 100644 --- a/generated/Normalizer/CompaniesNormalizer.php +++ b/generated/Normalizer/CompaniesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class CompaniesNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Companies' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Companies' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Company', 'json', $context); } $object->setCompanies($values); + unset($data['companies']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/CompanyNormalizer.php b/generated/Normalizer/CompanyNormalizer.php index 827888e..05b6b02 100644 --- a/generated/Normalizer/CompanyNormalizer.php +++ b/generated/Normalizer/CompanyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class CompanyNormalizer implements DenormalizerInterface, NormalizerInterface, D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Company' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Company' === \get_class($data); } @@ -57,104 +59,129 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('base_uri', $data) && null !== $data['base_uri']) { $object->setBaseUri($data['base_uri']); + unset($data['base_uri']); } elseif (\array_key_exists('base_uri', $data) && null === $data['base_uri']) { $object->setBaseUri(null); } if (\array_key_exists('full_domain', $data) && null !== $data['full_domain']) { $object->setFullDomain($data['full_domain']); + unset($data['full_domain']); } elseif (\array_key_exists('full_domain', $data) && null === $data['full_domain']) { $object->setFullDomain(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('week_start_day', $data) && null !== $data['week_start_day']) { $object->setWeekStartDay($data['week_start_day']); + unset($data['week_start_day']); } elseif (\array_key_exists('week_start_day', $data) && null === $data['week_start_day']) { $object->setWeekStartDay(null); } if (\array_key_exists('wants_timestamp_timers', $data) && null !== $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers($data['wants_timestamp_timers']); + unset($data['wants_timestamp_timers']); } elseif (\array_key_exists('wants_timestamp_timers', $data) && null === $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers(null); } if (\array_key_exists('time_format', $data) && null !== $data['time_format']) { $object->setTimeFormat($data['time_format']); + unset($data['time_format']); } elseif (\array_key_exists('time_format', $data) && null === $data['time_format']) { $object->setTimeFormat(null); } if (\array_key_exists('date_format', $data) && null !== $data['date_format']) { $object->setDateFormat($data['date_format']); + unset($data['date_format']); } elseif (\array_key_exists('date_format', $data) && null === $data['date_format']) { $object->setDateFormat(null); } if (\array_key_exists('plan_type', $data) && null !== $data['plan_type']) { $object->setPlanType($data['plan_type']); + unset($data['plan_type']); } elseif (\array_key_exists('plan_type', $data) && null === $data['plan_type']) { $object->setPlanType(null); } if (\array_key_exists('clock', $data) && null !== $data['clock']) { $object->setClock($data['clock']); + unset($data['clock']); } elseif (\array_key_exists('clock', $data) && null === $data['clock']) { $object->setClock(null); } if (\array_key_exists('currency_code_display', $data) && null !== $data['currency_code_display']) { $object->setCurrencyCodeDisplay($data['currency_code_display']); + unset($data['currency_code_display']); } elseif (\array_key_exists('currency_code_display', $data) && null === $data['currency_code_display']) { $object->setCurrencyCodeDisplay(null); } if (\array_key_exists('currency_symbol_display', $data) && null !== $data['currency_symbol_display']) { $object->setCurrencySymbolDisplay($data['currency_symbol_display']); + unset($data['currency_symbol_display']); } elseif (\array_key_exists('currency_symbol_display', $data) && null === $data['currency_symbol_display']) { $object->setCurrencySymbolDisplay(null); } if (\array_key_exists('decimal_symbol', $data) && null !== $data['decimal_symbol']) { $object->setDecimalSymbol($data['decimal_symbol']); + unset($data['decimal_symbol']); } elseif (\array_key_exists('decimal_symbol', $data) && null === $data['decimal_symbol']) { $object->setDecimalSymbol(null); } if (\array_key_exists('thousands_separator', $data) && null !== $data['thousands_separator']) { $object->setThousandsSeparator($data['thousands_separator']); + unset($data['thousands_separator']); } elseif (\array_key_exists('thousands_separator', $data) && null === $data['thousands_separator']) { $object->setThousandsSeparator(null); } if (\array_key_exists('color_scheme', $data) && null !== $data['color_scheme']) { $object->setColorScheme($data['color_scheme']); + unset($data['color_scheme']); } elseif (\array_key_exists('color_scheme', $data) && null === $data['color_scheme']) { $object->setColorScheme(null); } if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } if (\array_key_exists('expense_feature', $data) && null !== $data['expense_feature']) { $object->setExpenseFeature($data['expense_feature']); + unset($data['expense_feature']); } elseif (\array_key_exists('expense_feature', $data) && null === $data['expense_feature']) { $object->setExpenseFeature(null); } if (\array_key_exists('invoice_feature', $data) && null !== $data['invoice_feature']) { $object->setInvoiceFeature($data['invoice_feature']); + unset($data['invoice_feature']); } elseif (\array_key_exists('invoice_feature', $data) && null === $data['invoice_feature']) { $object->setInvoiceFeature(null); } if (\array_key_exists('estimate_feature', $data) && null !== $data['estimate_feature']) { $object->setEstimateFeature($data['estimate_feature']); + unset($data['estimate_feature']); } elseif (\array_key_exists('estimate_feature', $data) && null === $data['estimate_feature']) { $object->setEstimateFeature(null); } if (\array_key_exists('approval_feature', $data) && null !== $data['approval_feature']) { $object->setApprovalFeature($data['approval_feature']); + unset($data['approval_feature']); } elseif (\array_key_exists('approval_feature', $data) && null === $data['approval_feature']) { $object->setApprovalFeature(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -168,66 +195,71 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getBaseUri()) { + if ($object->isInitialized('baseUri') && null !== $object->getBaseUri()) { $data['base_uri'] = $object->getBaseUri(); } - if (null !== $object->getFullDomain()) { + if ($object->isInitialized('fullDomain') && null !== $object->getFullDomain()) { $data['full_domain'] = $object->getFullDomain(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getWeekStartDay()) { + if ($object->isInitialized('weekStartDay') && null !== $object->getWeekStartDay()) { $data['week_start_day'] = $object->getWeekStartDay(); } - if (null !== $object->getWantsTimestampTimers()) { + if ($object->isInitialized('wantsTimestampTimers') && null !== $object->getWantsTimestampTimers()) { $data['wants_timestamp_timers'] = $object->getWantsTimestampTimers(); } - if (null !== $object->getTimeFormat()) { + if ($object->isInitialized('timeFormat') && null !== $object->getTimeFormat()) { $data['time_format'] = $object->getTimeFormat(); } - if (null !== $object->getDateFormat()) { + if ($object->isInitialized('dateFormat') && null !== $object->getDateFormat()) { $data['date_format'] = $object->getDateFormat(); } - if (null !== $object->getPlanType()) { + if ($object->isInitialized('planType') && null !== $object->getPlanType()) { $data['plan_type'] = $object->getPlanType(); } - if (null !== $object->getClock()) { + if ($object->isInitialized('clock') && null !== $object->getClock()) { $data['clock'] = $object->getClock(); } - if (null !== $object->getCurrencyCodeDisplay()) { + if ($object->isInitialized('currencyCodeDisplay') && null !== $object->getCurrencyCodeDisplay()) { $data['currency_code_display'] = $object->getCurrencyCodeDisplay(); } - if (null !== $object->getCurrencySymbolDisplay()) { + if ($object->isInitialized('currencySymbolDisplay') && null !== $object->getCurrencySymbolDisplay()) { $data['currency_symbol_display'] = $object->getCurrencySymbolDisplay(); } - if (null !== $object->getDecimalSymbol()) { + if ($object->isInitialized('decimalSymbol') && null !== $object->getDecimalSymbol()) { $data['decimal_symbol'] = $object->getDecimalSymbol(); } - if (null !== $object->getThousandsSeparator()) { + if ($object->isInitialized('thousandsSeparator') && null !== $object->getThousandsSeparator()) { $data['thousands_separator'] = $object->getThousandsSeparator(); } - if (null !== $object->getColorScheme()) { + if ($object->isInitialized('colorScheme') && null !== $object->getColorScheme()) { $data['color_scheme'] = $object->getColorScheme(); } - if (null !== $object->getWeeklyCapacity()) { + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { $data['weekly_capacity'] = $object->getWeeklyCapacity(); } - if (null !== $object->getExpenseFeature()) { + if ($object->isInitialized('expenseFeature') && null !== $object->getExpenseFeature()) { $data['expense_feature'] = $object->getExpenseFeature(); } - if (null !== $object->getInvoiceFeature()) { + if ($object->isInitialized('invoiceFeature') && null !== $object->getInvoiceFeature()) { $data['invoice_feature'] = $object->getInvoiceFeature(); } - if (null !== $object->getEstimateFeature()) { + if ($object->isInitialized('estimateFeature') && null !== $object->getEstimateFeature()) { $data['estimate_feature'] = $object->getEstimateFeature(); } - if (null !== $object->getApprovalFeature()) { + if ($object->isInitialized('approvalFeature') && null !== $object->getApprovalFeature()) { $data['approval_feature'] = $object->getApprovalFeature(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/CompanyPatchBodyNormalizer.php b/generated/Normalizer/CompanyPatchBodyNormalizer.php index b21995a..28239f2 100644 --- a/generated/Normalizer/CompanyPatchBodyNormalizer.php +++ b/generated/Normalizer/CompanyPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class CompanyPatchBodyNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('wants_timestamp_timers', $data) && null !== $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers($data['wants_timestamp_timers']); + unset($data['wants_timestamp_timers']); } elseif (\array_key_exists('wants_timestamp_timers', $data) && null === $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers(null); } if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getWantsTimestampTimers()) { + if ($object->isInitialized('wantsTimestampTimers') && null !== $object->getWantsTimestampTimers()) { $data['wants_timestamp_timers'] = $object->getWantsTimestampTimers(); } - if (null !== $object->getWeeklyCapacity()) { + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { $data['weekly_capacity'] = $object->getWeeklyCapacity(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ContactClientNormalizer.php b/generated/Normalizer/ContactClientNormalizer.php index 84465d4..3285592 100644 --- a/generated/Normalizer/ContactClientNormalizer.php +++ b/generated/Normalizer/ContactClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ContactClientNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ContactClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ContactClient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ContactNormalizer.php b/generated/Normalizer/ContactNormalizer.php index 1a73f0d..0339152 100644 --- a/generated/Normalizer/ContactNormalizer.php +++ b/generated/Normalizer/ContactNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ContactNormalizer implements DenormalizerInterface, NormalizerInterface, D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Contact' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Contact' === \get_class($data); } @@ -57,59 +59,75 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ContactClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } if (\array_key_exists('title', $data) && null !== $data['title']) { $object->setTitle($data['title']); + unset($data['title']); } elseif (\array_key_exists('title', $data) && null === $data['title']) { $object->setTitle(null); } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } if (\array_key_exists('phone_office', $data) && null !== $data['phone_office']) { $object->setPhoneOffice($data['phone_office']); + unset($data['phone_office']); } elseif (\array_key_exists('phone_office', $data) && null === $data['phone_office']) { $object->setPhoneOffice(null); } if (\array_key_exists('phone_mobile', $data) && null !== $data['phone_mobile']) { $object->setPhoneMobile($data['phone_mobile']); + unset($data['phone_mobile']); } elseif (\array_key_exists('phone_mobile', $data) && null === $data['phone_mobile']) { $object->setPhoneMobile(null); } if (\array_key_exists('fax', $data) && null !== $data['fax']) { $object->setFax($data['fax']); + unset($data['fax']); } elseif (\array_key_exists('fax', $data) && null === $data['fax']) { $object->setFax(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -123,39 +141,44 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getTitle()) { + if ($object->isInitialized('title') && null !== $object->getTitle()) { $data['title'] = $object->getTitle(); } - if (null !== $object->getFirstName()) { + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { $data['first_name'] = $object->getFirstName(); } - if (null !== $object->getLastName()) { + if ($object->isInitialized('lastName') && null !== $object->getLastName()) { $data['last_name'] = $object->getLastName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } - if (null !== $object->getPhoneOffice()) { + if ($object->isInitialized('phoneOffice') && null !== $object->getPhoneOffice()) { $data['phone_office'] = $object->getPhoneOffice(); } - if (null !== $object->getPhoneMobile()) { + if ($object->isInitialized('phoneMobile') && null !== $object->getPhoneMobile()) { $data['phone_mobile'] = $object->getPhoneMobile(); } - if (null !== $object->getFax()) { + if ($object->isInitialized('fax') && null !== $object->getFax()) { $data['fax'] = $object->getFax(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php b/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php index e2315a5..0331e8f 100644 --- a/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ContactsContactIdPatchBodyNormalizer implements DenormalizerInterface, Nor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody' === \get_class($data); } @@ -57,44 +59,57 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('title', $data) && null !== $data['title']) { $object->setTitle($data['title']); + unset($data['title']); } elseif (\array_key_exists('title', $data) && null === $data['title']) { $object->setTitle(null); } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } if (\array_key_exists('phone_office', $data) && null !== $data['phone_office']) { $object->setPhoneOffice($data['phone_office']); + unset($data['phone_office']); } elseif (\array_key_exists('phone_office', $data) && null === $data['phone_office']) { $object->setPhoneOffice(null); } if (\array_key_exists('phone_mobile', $data) && null !== $data['phone_mobile']) { $object->setPhoneMobile($data['phone_mobile']); + unset($data['phone_mobile']); } elseif (\array_key_exists('phone_mobile', $data) && null === $data['phone_mobile']) { $object->setPhoneMobile(null); } if (\array_key_exists('fax', $data) && null !== $data['fax']) { $object->setFax($data['fax']); + unset($data['fax']); } elseif (\array_key_exists('fax', $data) && null === $data['fax']) { $object->setFax(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -108,30 +123,35 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getTitle()) { + if ($object->isInitialized('title') && null !== $object->getTitle()) { $data['title'] = $object->getTitle(); } - if (null !== $object->getFirstName()) { + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { $data['first_name'] = $object->getFirstName(); } - if (null !== $object->getLastName()) { + if ($object->isInitialized('lastName') && null !== $object->getLastName()) { $data['last_name'] = $object->getLastName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } - if (null !== $object->getPhoneOffice()) { + if ($object->isInitialized('phoneOffice') && null !== $object->getPhoneOffice()) { $data['phone_office'] = $object->getPhoneOffice(); } - if (null !== $object->getPhoneMobile()) { + if ($object->isInitialized('phoneMobile') && null !== $object->getPhoneMobile()) { $data['phone_mobile'] = $object->getPhoneMobile(); } - if (null !== $object->getFax()) { + if ($object->isInitialized('fax') && null !== $object->getFax()) { $data['fax'] = $object->getFax(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ContactsNormalizer.php b/generated/Normalizer/ContactsNormalizer.php index c6fdf85..bdd392e 100644 --- a/generated/Normalizer/ContactsNormalizer.php +++ b/generated/Normalizer/ContactsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ContactsNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Contacts' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Contacts' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json', $context); } $object->setContacts($values); + unset($data['contacts']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ContactsPostBodyNormalizer.php b/generated/Normalizer/ContactsPostBodyNormalizer.php index 4657849..61f1f62 100644 --- a/generated/Normalizer/ContactsPostBodyNormalizer.php +++ b/generated/Normalizer/ContactsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ContactsPostBodyNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody' === \get_class($data); } @@ -57,44 +59,57 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('title', $data) && null !== $data['title']) { $object->setTitle($data['title']); + unset($data['title']); } elseif (\array_key_exists('title', $data) && null === $data['title']) { $object->setTitle(null); } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } if (\array_key_exists('phone_office', $data) && null !== $data['phone_office']) { $object->setPhoneOffice($data['phone_office']); + unset($data['phone_office']); } elseif (\array_key_exists('phone_office', $data) && null === $data['phone_office']) { $object->setPhoneOffice(null); } if (\array_key_exists('phone_mobile', $data) && null !== $data['phone_mobile']) { $object->setPhoneMobile($data['phone_mobile']); + unset($data['phone_mobile']); } elseif (\array_key_exists('phone_mobile', $data) && null === $data['phone_mobile']) { $object->setPhoneMobile(null); } if (\array_key_exists('fax', $data) && null !== $data['fax']) { $object->setFax($data['fax']); + unset($data['fax']); } elseif (\array_key_exists('fax', $data) && null === $data['fax']) { $object->setFax(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -109,25 +124,30 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['client_id'] = $object->getClientId(); - if (null !== $object->getTitle()) { + if ($object->isInitialized('title') && null !== $object->getTitle()) { $data['title'] = $object->getTitle(); } $data['first_name'] = $object->getFirstName(); - if (null !== $object->getLastName()) { + if ($object->isInitialized('lastName') && null !== $object->getLastName()) { $data['last_name'] = $object->getLastName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } - if (null !== $object->getPhoneOffice()) { + if ($object->isInitialized('phoneOffice') && null !== $object->getPhoneOffice()) { $data['phone_office'] = $object->getPhoneOffice(); } - if (null !== $object->getPhoneMobile()) { + if ($object->isInitialized('phoneMobile') && null !== $object->getPhoneMobile()) { $data['phone_mobile'] = $object->getPhoneMobile(); } - if (null !== $object->getFax()) { + if ($object->isInitialized('fax') && null !== $object->getFax()) { $data['fax'] = $object->getFax(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/CostRateNormalizer.php b/generated/Normalizer/CostRateNormalizer.php index c176072..01967d6 100644 --- a/generated/Normalizer/CostRateNormalizer.php +++ b/generated/Normalizer/CostRateNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class CostRateNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\CostRate' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\CostRate' === \get_class($data); } @@ -52,39 +54,53 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\CostRate(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } if (\array_key_exists('end_date', $data) && null !== $data['end_date']) { $object->setEndDate(\DateTime::createFromFormat('Y-m-d', $data['end_date'])->setTime(0, 0, 0)); + unset($data['end_date']); } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { $object->setEndDate(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -98,24 +114,29 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getStartDate()) { + if ($object->isInitialized('startDate') && null !== $object->getStartDate()) { $data['start_date'] = $object->getStartDate()->format('Y-m-d'); } - if (null !== $object->getEndDate()) { + if ($object->isInitialized('endDate') && null !== $object->getEndDate()) { $data['end_date'] = $object->getEndDate()->format('Y-m-d'); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/CostRatesNormalizer.php b/generated/Normalizer/CostRatesNormalizer.php index 2a6602d..ecdec8c 100644 --- a/generated/Normalizer/CostRatesNormalizer.php +++ b/generated/Normalizer/CostRatesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class CostRatesNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\CostRates' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\CostRates' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json', $context); } $object->setCostRates($values); + unset($data['cost_rates']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ErrorNormalizer.php b/generated/Normalizer/ErrorNormalizer.php index 88d7551..330ece1 100644 --- a/generated/Normalizer/ErrorNormalizer.php +++ b/generated/Normalizer/ErrorNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, Den use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Error' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Error' === \get_class($data); } @@ -57,9 +59,16 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('code', $data)) { $object->setCode($data['code']); + unset($data['code']); } if (\array_key_exists('message', $data)) { $object->setMessage($data['message']); + unset($data['message']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -74,12 +83,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } - if (null !== $object->getMessage()) { + if ($object->isInitialized('message') && null !== $object->getMessage()) { $data['message'] = $object->getMessage(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateClientNormalizer.php b/generated/Normalizer/EstimateClientNormalizer.php index b84bc7c..a7de523 100644 --- a/generated/Normalizer/EstimateClientNormalizer.php +++ b/generated/Normalizer/EstimateClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateClientNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateClient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateCreatorNormalizer.php b/generated/Normalizer/EstimateCreatorNormalizer.php index d90f3d5..a93eed9 100644 --- a/generated/Normalizer/EstimateCreatorNormalizer.php +++ b/generated/Normalizer/EstimateCreatorNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateCreatorNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php b/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php index e5547bf..266e90f 100644 --- a/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer implements use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -73,9 +81,14 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateItemCategoriesNormalizer.php b/generated/Normalizer/EstimateItemCategoriesNormalizer.php index 11c21e8..b8e66c1 100644 --- a/generated/Normalizer/EstimateItemCategoriesNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoriesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateItemCategoriesNormalizer implements DenormalizerInterface, Normali use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json', $context); } $object->setEstimateItemCategories($values); + unset($data['estimate_item_categories']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php b/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php index 5f654d1..11df5c7 100644 --- a/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateItemCategoriesPostBodyNormalizer implements DenormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -74,6 +82,11 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['name'] = $object->getName(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateItemCategoryNormalizer.php b/generated/Normalizer/EstimateItemCategoryNormalizer.php index a170671..2963df6 100644 --- a/generated/Normalizer/EstimateItemCategoryNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoryNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateItemCategoryNormalizer implements DenormalizerInterface, Normalize use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateLineItemNormalizer.php b/generated/Normalizer/EstimateLineItemNormalizer.php index 3bd2b91..3e41a53 100644 --- a/generated/Normalizer/EstimateLineItemNormalizer.php +++ b/generated/Normalizer/EstimateLineItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateLineItemNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem' === \get_class($data); } @@ -52,49 +54,71 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\EstimateLineItem(); + if (\array_key_exists('quantity', $data) && \is_int($data['quantity'])) { + $data['quantity'] = (float) $data['quantity']; + } + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('kind', $data) && null !== $data['kind']) { $object->setKind($data['kind']); + unset($data['kind']); } elseif (\array_key_exists('kind', $data) && null === $data['kind']) { $object->setKind(null); } if (\array_key_exists('description', $data) && null !== $data['description']) { $object->setDescription($data['description']); + unset($data['description']); } elseif (\array_key_exists('description', $data) && null === $data['description']) { $object->setDescription(null); } if (\array_key_exists('quantity', $data) && null !== $data['quantity']) { $object->setQuantity($data['quantity']); + unset($data['quantity']); } elseif (\array_key_exists('quantity', $data) && null === $data['quantity']) { $object->setQuantity(null); } if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('taxed', $data) && null !== $data['taxed']) { $object->setTaxed($data['taxed']); + unset($data['taxed']); } elseif (\array_key_exists('taxed', $data) && null === $data['taxed']) { $object->setTaxed(null); } if (\array_key_exists('taxed2', $data) && null !== $data['taxed2']) { $object->setTaxed2($data['taxed2']); + unset($data['taxed2']); } elseif (\array_key_exists('taxed2', $data) && null === $data['taxed2']) { $object->setTaxed2(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -108,30 +132,35 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getKind()) { + if ($object->isInitialized('kind') && null !== $object->getKind()) { $data['kind'] = $object->getKind(); } - if (null !== $object->getDescription()) { + if ($object->isInitialized('description') && null !== $object->getDescription()) { $data['description'] = $object->getDescription(); } - if (null !== $object->getQuantity()) { + if ($object->isInitialized('quantity') && null !== $object->getQuantity()) { $data['quantity'] = $object->getQuantity(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getTaxed()) { + if ($object->isInitialized('taxed') && null !== $object->getTaxed()) { $data['taxed'] = $object->getTaxed(); } - if (null !== $object->getTaxed2()) { + if ($object->isInitialized('taxed2') && null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateLineItemsNormalizer.php b/generated/Normalizer/EstimateLineItemsNormalizer.php index 63058f3..8dbc68b 100644 --- a/generated/Normalizer/EstimateLineItemsNormalizer.php +++ b/generated/Normalizer/EstimateLineItemsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateLineItemsNormalizer implements DenormalizerInterface, NormalizerIn use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem', 'json', $context); } $object->setEstimateLineItems($values); + unset($data['estimate_line_items']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimateMessageNormalizer.php b/generated/Normalizer/EstimateMessageNormalizer.php index 5fc18b1..3769458 100644 --- a/generated/Normalizer/EstimateMessageNormalizer.php +++ b/generated/Normalizer/EstimateMessageNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateMessageNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage' === \get_class($data); } @@ -57,26 +59,31 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('sent_by', $data) && null !== $data['sent_by']) { $object->setSentBy($data['sent_by']); + unset($data['sent_by']); } elseif (\array_key_exists('sent_by', $data) && null === $data['sent_by']) { $object->setSentBy(null); } if (\array_key_exists('sent_by_email', $data) && null !== $data['sent_by_email']) { $object->setSentByEmail($data['sent_by_email']); + unset($data['sent_by_email']); } elseif (\array_key_exists('sent_by_email', $data) && null === $data['sent_by_email']) { $object->setSentByEmail(null); } if (\array_key_exists('sent_from', $data) && null !== $data['sent_from']) { $object->setSentFrom($data['sent_from']); + unset($data['sent_from']); } elseif (\array_key_exists('sent_from', $data) && null === $data['sent_from']) { $object->setSentFrom(null); } if (\array_key_exists('sent_from_email', $data) && null !== $data['sent_from_email']) { $object->setSentFromEmail($data['sent_from_email']); + unset($data['sent_from_email']); } elseif (\array_key_exists('sent_from_email', $data) && null === $data['sent_from_email']) { $object->setSentFromEmail(null); } @@ -86,39 +93,51 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient', 'json', $context); } $object->setRecipients($values); + unset($data['recipients']); } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); + unset($data['body']); } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); + unset($data['send_me_a_copy']); } elseif (\array_key_exists('send_me_a_copy', $data) && null === $data['send_me_a_copy']) { $object->setSendMeACopy(null); } if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); + unset($data['event_type']); } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -132,46 +151,51 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getSentBy()) { + if ($object->isInitialized('sentBy') && null !== $object->getSentBy()) { $data['sent_by'] = $object->getSentBy(); } - if (null !== $object->getSentByEmail()) { + if ($object->isInitialized('sentByEmail') && null !== $object->getSentByEmail()) { $data['sent_by_email'] = $object->getSentByEmail(); } - if (null !== $object->getSentFrom()) { + if ($object->isInitialized('sentFrom') && null !== $object->getSentFrom()) { $data['sent_from'] = $object->getSentFrom(); } - if (null !== $object->getSentFromEmail()) { + if ($object->isInitialized('sentFromEmail') && null !== $object->getSentFromEmail()) { $data['sent_from_email'] = $object->getSentFromEmail(); } - if (null !== $object->getRecipients()) { + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { $values = []; foreach ($object->getRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['recipients'] = $values; } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getBody()) { + if ($object->isInitialized('body') && null !== $object->getBody()) { $data['body'] = $object->getBody(); } - if (null !== $object->getSendMeACopy()) { + if ($object->isInitialized('sendMeACopy') && null !== $object->getSendMeACopy()) { $data['send_me_a_copy'] = $object->getSendMeACopy(); } - if (null !== $object->getEventType()) { + if ($object->isInitialized('eventType') && null !== $object->getEventType()) { $data['event_type'] = $object->getEventType(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimateMessageRecipientNormalizer.php b/generated/Normalizer/EstimateMessageRecipientNormalizer.php index 54cbfa3..dbb174b 100644 --- a/generated/Normalizer/EstimateMessageRecipientNormalizer.php +++ b/generated/Normalizer/EstimateMessageRecipientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateMessageRecipientNormalizer implements DenormalizerInterface, Norma use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimateMessageRecipientsNormalizer.php b/generated/Normalizer/EstimateMessageRecipientsNormalizer.php index fec3db8..f404c02 100644 --- a/generated/Normalizer/EstimateMessageRecipientsNormalizer.php +++ b/generated/Normalizer/EstimateMessageRecipientsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateMessageRecipientsNormalizer implements DenormalizerInterface, Norm use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient', 'json', $context); } $object->setEstimateMessageRecipients($values); + unset($data['estimate_message_recipients']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimateMessagesNormalizer.php b/generated/Normalizer/EstimateMessagesNormalizer.php index 3fe6c0a..83b2322 100644 --- a/generated/Normalizer/EstimateMessagesNormalizer.php +++ b/generated/Normalizer/EstimateMessagesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateMessagesNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage', 'json', $context); } $object->setEstimateMessages($values); + unset($data['estimate_messages']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimateNormalizer.php b/generated/Normalizer/EstimateNormalizer.php index 7d75758..c07fc9d 100644 --- a/generated/Normalizer/EstimateNormalizer.php +++ b/generated/Normalizer/EstimateNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimateNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Estimate' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Estimate' === \get_class($data); } @@ -52,16 +54,39 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\Estimate(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } + if (\array_key_exists('tax', $data) && \is_int($data['tax'])) { + $data['tax'] = (float) $data['tax']; + } + if (\array_key_exists('tax_amount', $data) && \is_int($data['tax_amount'])) { + $data['tax_amount'] = (float) $data['tax_amount']; + } + if (\array_key_exists('tax2', $data) && \is_int($data['tax2'])) { + $data['tax2'] = (float) $data['tax2']; + } + if (\array_key_exists('tax2_amount', $data) && \is_int($data['tax2_amount'])) { + $data['tax2_amount'] = (float) $data['tax2_amount']; + } + if (\array_key_exists('discount', $data) && \is_int($data['discount'])) { + $data['discount'] = (float) $data['discount']; + } + if (\array_key_exists('discount_amount', $data) && \is_int($data['discount_amount'])) { + $data['discount_amount'] = (float) $data['discount_amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\EstimateClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } @@ -71,114 +96,141 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem', 'json', $context); } $object->setLineItems($values); + unset($data['line_items']); } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } if (\array_key_exists('creator', $data) && null !== $data['creator']) { $object->setCreator($this->denormalizer->denormalize($data['creator'], 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator', 'json', $context)); + unset($data['creator']); } elseif (\array_key_exists('creator', $data) && null === $data['creator']) { $object->setCreator(null); } if (\array_key_exists('client_key', $data) && null !== $data['client_key']) { $object->setClientKey($data['client_key']); + unset($data['client_key']); } elseif (\array_key_exists('client_key', $data) && null === $data['client_key']) { $object->setClientKey(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); + unset($data['purchase_order']); } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); + unset($data['tax']); } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } if (\array_key_exists('tax_amount', $data) && null !== $data['tax_amount']) { $object->setTaxAmount($data['tax_amount']); + unset($data['tax_amount']); } elseif (\array_key_exists('tax_amount', $data) && null === $data['tax_amount']) { $object->setTaxAmount(null); } if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); + unset($data['tax2']); } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } if (\array_key_exists('tax2_amount', $data) && null !== $data['tax2_amount']) { $object->setTax2Amount($data['tax2_amount']); + unset($data['tax2_amount']); } elseif (\array_key_exists('tax2_amount', $data) && null === $data['tax2_amount']) { $object->setTax2Amount(null); } if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); + unset($data['discount']); } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } if (\array_key_exists('discount_amount', $data) && null !== $data['discount_amount']) { $object->setDiscountAmount($data['discount_amount']); + unset($data['discount_amount']); } elseif (\array_key_exists('discount_amount', $data) && null === $data['discount_amount']) { $object->setDiscountAmount(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('state', $data) && null !== $data['state']) { $object->setState($data['state']); + unset($data['state']); } elseif (\array_key_exists('state', $data) && null === $data['state']) { $object->setState(null); } if (\array_key_exists('issue_date', $data) && null !== $data['issue_date']) { $object->setIssueDate(\DateTime::createFromFormat('Y-m-d', $data['issue_date'])->setTime(0, 0, 0)); + unset($data['issue_date']); } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } if (\array_key_exists('sent_at', $data) && null !== $data['sent_at']) { $object->setSentAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['sent_at'])); + unset($data['sent_at']); } elseif (\array_key_exists('sent_at', $data) && null === $data['sent_at']) { $object->setSentAt(null); } if (\array_key_exists('accepted_at', $data) && null !== $data['accepted_at']) { $object->setAcceptedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['accepted_at'])); + unset($data['accepted_at']); } elseif (\array_key_exists('accepted_at', $data) && null === $data['accepted_at']) { $object->setAcceptedAt(null); } if (\array_key_exists('declined_at', $data) && null !== $data['declined_at']) { $object->setDeclinedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['declined_at'])); + unset($data['declined_at']); } elseif (\array_key_exists('declined_at', $data) && null === $data['declined_at']) { $object->setDeclinedAt(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -192,82 +244,87 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getLineItems()) { + if ($object->isInitialized('lineItems') && null !== $object->getLineItems()) { $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } - if (null !== $object->getCreator()) { + if ($object->isInitialized('creator') && null !== $object->getCreator()) { $data['creator'] = $this->normalizer->normalize($object->getCreator(), 'json', $context); } - if (null !== $object->getClientKey()) { + if ($object->isInitialized('clientKey') && null !== $object->getClientKey()) { $data['client_key'] = $object->getClientKey(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } - if (null !== $object->getPurchaseOrder()) { + if ($object->isInitialized('purchaseOrder') && null !== $object->getPurchaseOrder()) { $data['purchase_order'] = $object->getPurchaseOrder(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getTax()) { + if ($object->isInitialized('tax') && null !== $object->getTax()) { $data['tax'] = $object->getTax(); } - if (null !== $object->getTaxAmount()) { + if ($object->isInitialized('taxAmount') && null !== $object->getTaxAmount()) { $data['tax_amount'] = $object->getTaxAmount(); } - if (null !== $object->getTax2()) { + if ($object->isInitialized('tax2') && null !== $object->getTax2()) { $data['tax2'] = $object->getTax2(); } - if (null !== $object->getTax2Amount()) { + if ($object->isInitialized('tax2Amount') && null !== $object->getTax2Amount()) { $data['tax2_amount'] = $object->getTax2Amount(); } - if (null !== $object->getDiscount()) { + if ($object->isInitialized('discount') && null !== $object->getDiscount()) { $data['discount'] = $object->getDiscount(); } - if (null !== $object->getDiscountAmount()) { + if ($object->isInitialized('discountAmount') && null !== $object->getDiscountAmount()) { $data['discount_amount'] = $object->getDiscountAmount(); } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getState()) { + if ($object->isInitialized('state') && null !== $object->getState()) { $data['state'] = $object->getState(); } - if (null !== $object->getIssueDate()) { + if ($object->isInitialized('issueDate') && null !== $object->getIssueDate()) { $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } - if (null !== $object->getSentAt()) { + if ($object->isInitialized('sentAt') && null !== $object->getSentAt()) { $data['sent_at'] = $object->getSentAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getAcceptedAt()) { + if ($object->isInitialized('acceptedAt') && null !== $object->getAcceptedAt()) { $data['accepted_at'] = $object->getAcceptedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getDeclinedAt()) { + if ($object->isInitialized('declinedAt') && null !== $object->getDeclinedAt()) { $data['declined_at'] = $object->getDeclinedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php index 401c30c..377f7b7 100644 --- a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesEstimateIdMessagesPostBodyNormalizer implements DenormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody' === \get_class($data); } @@ -57,6 +59,7 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); + unset($data['event_type']); } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } @@ -66,24 +69,33 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem', 'json', $context); } $object->setRecipients($values); + unset($data['recipients']); } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); + unset($data['body']); } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); + unset($data['send_me_a_copy']); } elseif (\array_key_exists('send_me_a_copy', $data) && null === $data['send_me_a_copy']) { $object->setSendMeACopy(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -97,7 +109,7 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getEventType()) { + if ($object->isInitialized('eventType') && null !== $object->getEventType()) { $data['event_type'] = $object->getEventType(); } $values = []; @@ -105,15 +117,20 @@ public function normalize($object, $format = null, array $context = []) $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['recipients'] = $values; - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getBody()) { + if ($object->isInitialized('body') && null !== $object->getBody()) { $data['body'] = $object->getBody(); } - if (null !== $object->getSendMeACopy()) { + if ($object->isInitialized('sendMeACopy') && null !== $object->getSendMeACopy()) { $data['send_me_a_copy'] = $object->getSendMeACopy(); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php index 1b0468c..b016aed 100644 --- a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer implements Den use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem' === \get_class($data); } @@ -57,9 +59,16 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data)) { $object->setName($data['name']); + unset($data['name']); } if (\array_key_exists('email', $data)) { $object->setEmail($data['email']); + unset($data['email']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -74,10 +83,15 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } $data['email'] = $object->getEmail(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php b/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php index 9134445..5fe154d 100644 --- a/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesEstimateIdPatchBodyLineItemsItemNormalizer implements Denormalize use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem' === \get_class($data); } @@ -52,29 +54,44 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBodyLineItemsItem(); + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data)) { $object->setId($data['id']); + unset($data['id']); } if (\array_key_exists('kind', $data)) { $object->setKind($data['kind']); + unset($data['kind']); } if (\array_key_exists('description', $data)) { $object->setDescription($data['description']); + unset($data['description']); } if (\array_key_exists('quantity', $data)) { $object->setQuantity($data['quantity']); + unset($data['quantity']); } if (\array_key_exists('unit_price', $data)) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } if (\array_key_exists('taxed', $data)) { $object->setTaxed($data['taxed']); + unset($data['taxed']); } if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); + unset($data['taxed2']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -89,27 +106,32 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getKind()) { + if ($object->isInitialized('kind') && null !== $object->getKind()) { $data['kind'] = $object->getKind(); } - if (null !== $object->getDescription()) { + if ($object->isInitialized('description') && null !== $object->getDescription()) { $data['description'] = $object->getDescription(); } - if (null !== $object->getQuantity()) { + if ($object->isInitialized('quantity') && null !== $object->getQuantity()) { $data['quantity'] = $object->getQuantity(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getTaxed()) { + if ($object->isInitialized('taxed') && null !== $object->getTaxed()) { $data['taxed'] = $object->getTaxed(); } - if (null !== $object->getTaxed2()) { + if ($object->isInitialized('taxed2') && null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php b/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php index 7505483..5764d5c 100644 --- a/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesEstimateIdPatchBodyNormalizer implements DenormalizerInterface, N use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody' === \get_class($data); } @@ -52,56 +54,75 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody(); + if (\array_key_exists('tax', $data) && \is_int($data['tax'])) { + $data['tax'] = (float) $data['tax']; + } + if (\array_key_exists('tax2', $data) && \is_int($data['tax2'])) { + $data['tax2'] = (float) $data['tax2']; + } + if (\array_key_exists('discount', $data) && \is_int($data['discount'])) { + $data['discount'] = (float) $data['discount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); + unset($data['purchase_order']); } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); + unset($data['tax']); } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); + unset($data['tax2']); } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); + unset($data['discount']); } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('issue_date', $data) && null !== $data['issue_date']) { $object->setIssueDate(\DateTime::createFromFormat('Y-m-d', $data['issue_date'])->setTime(0, 0, 0)); + unset($data['issue_date']); } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } @@ -111,9 +132,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); + unset($data['line_items']); } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -127,43 +154,48 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } - if (null !== $object->getPurchaseOrder()) { + if ($object->isInitialized('purchaseOrder') && null !== $object->getPurchaseOrder()) { $data['purchase_order'] = $object->getPurchaseOrder(); } - if (null !== $object->getTax()) { + if ($object->isInitialized('tax') && null !== $object->getTax()) { $data['tax'] = $object->getTax(); } - if (null !== $object->getTax2()) { + if ($object->isInitialized('tax2') && null !== $object->getTax2()) { $data['tax2'] = $object->getTax2(); } - if (null !== $object->getDiscount()) { + if ($object->isInitialized('discount') && null !== $object->getDiscount()) { $data['discount'] = $object->getDiscount(); } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getIssueDate()) { + if ($object->isInitialized('issueDate') && null !== $object->getIssueDate()) { $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } - if (null !== $object->getLineItems()) { + if ($object->isInitialized('lineItems') && null !== $object->getLineItems()) { $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesNormalizer.php b/generated/Normalizer/EstimatesNormalizer.php index 0322e2e..b8fb5ea 100644 --- a/generated/Normalizer/EstimatesNormalizer.php +++ b/generated/Normalizer/EstimatesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Estimates' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Estimates' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json', $context); } $object->setEstimates($values); + unset($data['estimates']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php b/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php index 19b8471..45c871c 100644 --- a/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesPostBodyLineItemsItemNormalizer implements DenormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem' === \get_class($data); } @@ -52,26 +54,40 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\EstimatesPostBodyLineItemsItem(); + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('kind', $data)) { $object->setKind($data['kind']); + unset($data['kind']); } if (\array_key_exists('description', $data)) { $object->setDescription($data['description']); + unset($data['description']); } if (\array_key_exists('quantity', $data)) { $object->setQuantity($data['quantity']); + unset($data['quantity']); } if (\array_key_exists('unit_price', $data)) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } if (\array_key_exists('taxed', $data)) { $object->setTaxed($data['taxed']); + unset($data['taxed']); } if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); + unset($data['taxed2']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -87,19 +103,24 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['kind'] = $object->getKind(); - if (null !== $object->getDescription()) { + if ($object->isInitialized('description') && null !== $object->getDescription()) { $data['description'] = $object->getDescription(); } - if (null !== $object->getQuantity()) { + if ($object->isInitialized('quantity') && null !== $object->getQuantity()) { $data['quantity'] = $object->getQuantity(); } $data['unit_price'] = $object->getUnitPrice(); - if (null !== $object->getTaxed()) { + if ($object->isInitialized('taxed') && null !== $object->getTaxed()) { $data['taxed'] = $object->getTaxed(); } - if (null !== $object->getTaxed2()) { + if ($object->isInitialized('taxed2') && null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/EstimatesPostBodyNormalizer.php b/generated/Normalizer/EstimatesPostBodyNormalizer.php index 6758515..cc98fd8 100644 --- a/generated/Normalizer/EstimatesPostBodyNormalizer.php +++ b/generated/Normalizer/EstimatesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class EstimatesPostBodyNormalizer implements DenormalizerInterface, NormalizerIn use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody' === \get_class($data); } @@ -52,56 +54,75 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\EstimatesPostBody(); + if (\array_key_exists('tax', $data) && \is_int($data['tax'])) { + $data['tax'] = (float) $data['tax']; + } + if (\array_key_exists('tax2', $data) && \is_int($data['tax2'])) { + $data['tax2'] = (float) $data['tax2']; + } + if (\array_key_exists('discount', $data) && \is_int($data['discount'])) { + $data['discount'] = (float) $data['discount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); + unset($data['purchase_order']); } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); + unset($data['tax']); } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); + unset($data['tax2']); } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); + unset($data['discount']); } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('issue_date', $data) && null !== $data['issue_date']) { $object->setIssueDate(\DateTime::createFromFormat('Y-m-d', $data['issue_date'])->setTime(0, 0, 0)); + unset($data['issue_date']); } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } @@ -111,9 +132,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); + unset($data['line_items']); } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -128,40 +155,45 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['client_id'] = $object->getClientId(); - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } - if (null !== $object->getPurchaseOrder()) { + if ($object->isInitialized('purchaseOrder') && null !== $object->getPurchaseOrder()) { $data['purchase_order'] = $object->getPurchaseOrder(); } - if (null !== $object->getTax()) { + if ($object->isInitialized('tax') && null !== $object->getTax()) { $data['tax'] = $object->getTax(); } - if (null !== $object->getTax2()) { + if ($object->isInitialized('tax2') && null !== $object->getTax2()) { $data['tax2'] = $object->getTax2(); } - if (null !== $object->getDiscount()) { + if ($object->isInitialized('discount') && null !== $object->getDiscount()) { $data['discount'] = $object->getDiscount(); } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getIssueDate()) { + if ($object->isInitialized('issueDate') && null !== $object->getIssueDate()) { $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } - if (null !== $object->getLineItems()) { + if ($object->isInitialized('lineItems') && null !== $object->getLineItems()) { $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php b/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php index a562a2c..ba26af9 100644 --- a/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer implements Denormali use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody' === \get_class($data); } @@ -52,29 +54,41 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody(); + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); + unset($data['unit_name']); } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +102,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getUnitName()) { + if ($object->isInitialized('unitName') && null !== $object->getUnitName()) { $data['unit_name'] = $object->getUnitName(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseCategoriesNormalizer.php b/generated/Normalizer/ExpenseCategoriesNormalizer.php index 832e8e3..3304124 100644 --- a/generated/Normalizer/ExpenseCategoriesNormalizer.php +++ b/generated/Normalizer/ExpenseCategoriesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseCategoriesNormalizer implements DenormalizerInterface, NormalizerIn use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json', $context); } $object->setExpenseCategories($values); + unset($data['expense_categories']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php b/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php index 11fa00e..1ede192 100644 --- a/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php +++ b/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseCategoriesPostBodyNormalizer implements DenormalizerInterface, Norm use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody' === \get_class($data); } @@ -52,29 +54,41 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody(); + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); + unset($data['unit_name']); } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -89,15 +103,20 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['name'] = $object->getName(); - if (null !== $object->getUnitName()) { + if ($object->isInitialized('unitName') && null !== $object->getUnitName()) { $data['unit_name'] = $object->getUnitName(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseCategoryNormalizer.php b/generated/Normalizer/ExpenseCategoryNormalizer.php index 1ab7ff3..f4c76c6 100644 --- a/generated/Normalizer/ExpenseCategoryNormalizer.php +++ b/generated/Normalizer/ExpenseCategoryNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseCategoryNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory' === \get_class($data); } @@ -52,44 +54,59 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ExpenseCategory(); + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); + unset($data['unit_name']); } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -103,27 +120,32 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getUnitName()) { + if ($object->isInitialized('unitName') && null !== $object->getUnitName()) { $data['unit_name'] = $object->getUnitName(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseClientNormalizer.php b/generated/Normalizer/ExpenseClientNormalizer.php index 8335136..63a9f88 100644 --- a/generated/Normalizer/ExpenseClientNormalizer.php +++ b/generated/Normalizer/ExpenseClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseClientNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php b/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php index 04537c7..68d69a3 100644 --- a/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php +++ b/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseExpenseCategoryNormalizer implements DenormalizerInterface, Normali use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); + unset($data['unit_name']); } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getUnitName()) { + if ($object->isInitialized('unitName') && null !== $object->getUnitName()) { $data['unit_name'] = $object->getUnitName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseInvoiceNormalizer.php b/generated/Normalizer/ExpenseInvoiceNormalizer.php index 10f4ced..f475fc6 100644 --- a/generated/Normalizer/ExpenseInvoiceNormalizer.php +++ b/generated/Normalizer/ExpenseInvoiceNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseInvoiceNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseNormalizer.php b/generated/Normalizer/ExpenseNormalizer.php index b2989fe..cb5569b 100644 --- a/generated/Normalizer/ExpenseNormalizer.php +++ b/generated/Normalizer/ExpenseNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseNormalizer implements DenormalizerInterface, NormalizerInterface, D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Expense' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Expense' === \get_class($data); } @@ -52,102 +54,129 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\Expense(); + if (\array_key_exists('total_cost', $data) && \is_int($data['total_cost'])) { + $data['total_cost'] = (float) $data['total_cost']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject', 'json', $context)); + unset($data['project']); } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } if (\array_key_exists('expense_category', $data) && null !== $data['expense_category']) { $object->setExpenseCategory($this->denormalizer->denormalize($data['expense_category'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory', 'json', $context)); + unset($data['expense_category']); } elseif (\array_key_exists('expense_category', $data) && null === $data['expense_category']) { $object->setExpenseCategory(null); } if (\array_key_exists('user', $data) && null !== $data['user']) { $object->setUser($this->denormalizer->denormalize($data['user'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser', 'json', $context)); + unset($data['user']); } elseif (\array_key_exists('user', $data) && null === $data['user']) { $object->setUser(null); } if (\array_key_exists('user_assignment', $data)) { $object->setUserAssignment($this->denormalizer->denormalize($data['user_assignment'], 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json', $context)); + unset($data['user_assignment']); } if (\array_key_exists('receipt', $data) && null !== $data['receipt']) { $object->setReceipt($this->denormalizer->denormalize($data['receipt'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt', 'json', $context)); + unset($data['receipt']); } elseif (\array_key_exists('receipt', $data) && null === $data['receipt']) { $object->setReceipt(null); } if (\array_key_exists('invoice', $data) && null !== $data['invoice']) { $object->setInvoice($this->denormalizer->denormalize($data['invoice'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice', 'json', $context)); + unset($data['invoice']); } elseif (\array_key_exists('invoice', $data) && null === $data['invoice']) { $object->setInvoice(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('units', $data) && null !== $data['units']) { $object->setUnits($data['units']); + unset($data['units']); } elseif (\array_key_exists('units', $data) && null === $data['units']) { $object->setUnits(null); } if (\array_key_exists('total_cost', $data) && null !== $data['total_cost']) { $object->setTotalCost($data['total_cost']); + unset($data['total_cost']); } elseif (\array_key_exists('total_cost', $data) && null === $data['total_cost']) { $object->setTotalCost(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('is_closed', $data) && null !== $data['is_closed']) { $object->setIsClosed($data['is_closed']); + unset($data['is_closed']); } elseif (\array_key_exists('is_closed', $data) && null === $data['is_closed']) { $object->setIsClosed(null); } if (\array_key_exists('is_locked', $data) && null !== $data['is_locked']) { $object->setIsLocked($data['is_locked']); + unset($data['is_locked']); } elseif (\array_key_exists('is_locked', $data) && null === $data['is_locked']) { $object->setIsLocked(null); } if (\array_key_exists('is_billed', $data) && null !== $data['is_billed']) { $object->setIsBilled($data['is_billed']); + unset($data['is_billed']); } elseif (\array_key_exists('is_billed', $data) && null === $data['is_billed']) { $object->setIsBilled(null); } if (\array_key_exists('locked_reason', $data) && null !== $data['locked_reason']) { $object->setLockedReason($data['locked_reason']); + unset($data['locked_reason']); } elseif (\array_key_exists('locked_reason', $data) && null === $data['locked_reason']) { $object->setLockedReason(null); } if (\array_key_exists('spent_date', $data) && null !== $data['spent_date']) { $object->setSpentDate(\DateTime::createFromFormat('Y-m-d', $data['spent_date'])->setTime(0, 0, 0)); + unset($data['spent_date']); } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -161,63 +190,68 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getProject()) { + if ($object->isInitialized('project') && null !== $object->getProject()) { $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); } - if (null !== $object->getExpenseCategory()) { + if ($object->isInitialized('expenseCategory') && null !== $object->getExpenseCategory()) { $data['expense_category'] = $this->normalizer->normalize($object->getExpenseCategory(), 'json', $context); } - if (null !== $object->getUser()) { + if ($object->isInitialized('user') && null !== $object->getUser()) { $data['user'] = $this->normalizer->normalize($object->getUser(), 'json', $context); } - if (null !== $object->getUserAssignment()) { + if ($object->isInitialized('userAssignment') && null !== $object->getUserAssignment()) { $data['user_assignment'] = $this->normalizer->normalize($object->getUserAssignment(), 'json', $context); } - if (null !== $object->getReceipt()) { + if ($object->isInitialized('receipt') && null !== $object->getReceipt()) { $data['receipt'] = $this->normalizer->normalize($object->getReceipt(), 'json', $context); } - if (null !== $object->getInvoice()) { + if ($object->isInitialized('invoice') && null !== $object->getInvoice()) { $data['invoice'] = $this->normalizer->normalize($object->getInvoice(), 'json', $context); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getUnits()) { + if ($object->isInitialized('units') && null !== $object->getUnits()) { $data['units'] = $object->getUnits(); } - if (null !== $object->getTotalCost()) { + if ($object->isInitialized('totalCost') && null !== $object->getTotalCost()) { $data['total_cost'] = $object->getTotalCost(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getIsClosed()) { + if ($object->isInitialized('isClosed') && null !== $object->getIsClosed()) { $data['is_closed'] = $object->getIsClosed(); } - if (null !== $object->getIsLocked()) { + if ($object->isInitialized('isLocked') && null !== $object->getIsLocked()) { $data['is_locked'] = $object->getIsLocked(); } - if (null !== $object->getIsBilled()) { + if ($object->isInitialized('isBilled') && null !== $object->getIsBilled()) { $data['is_billed'] = $object->getIsBilled(); } - if (null !== $object->getLockedReason()) { + if ($object->isInitialized('lockedReason') && null !== $object->getLockedReason()) { $data['locked_reason'] = $object->getLockedReason(); } - if (null !== $object->getSpentDate()) { + if ($object->isInitialized('spentDate') && null !== $object->getSpentDate()) { $data['spent_date'] = $object->getSpentDate()->format('Y-m-d'); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseProjectNormalizer.php b/generated/Normalizer/ExpenseProjectNormalizer.php index ce9053b..a973d18 100644 --- a/generated/Normalizer/ExpenseProjectNormalizer.php +++ b/generated/Normalizer/ExpenseProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseProjectNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseReceiptNormalizer.php b/generated/Normalizer/ExpenseReceiptNormalizer.php index f2a886f..e3b7258 100644 --- a/generated/Normalizer/ExpenseReceiptNormalizer.php +++ b/generated/Normalizer/ExpenseReceiptNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseReceiptNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('url', $data) && null !== $data['url']) { $object->setUrl($data['url']); + unset($data['url']); } elseif (\array_key_exists('url', $data) && null === $data['url']) { $object->setUrl(null); } if (\array_key_exists('file_name', $data) && null !== $data['file_name']) { $object->setFileName($data['file_name']); + unset($data['file_name']); } elseif (\array_key_exists('file_name', $data) && null === $data['file_name']) { $object->setFileName(null); } if (\array_key_exists('file_size', $data) && null !== $data['file_size']) { $object->setFileSize($data['file_size']); + unset($data['file_size']); } elseif (\array_key_exists('file_size', $data) && null === $data['file_size']) { $object->setFileSize(null); } if (\array_key_exists('content_type', $data) && null !== $data['content_type']) { $object->setContentType($data['content_type']); + unset($data['content_type']); } elseif (\array_key_exists('content_type', $data) && null === $data['content_type']) { $object->setContentType(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getUrl()) { + if ($object->isInitialized('url') && null !== $object->getUrl()) { $data['url'] = $object->getUrl(); } - if (null !== $object->getFileName()) { + if ($object->isInitialized('fileName') && null !== $object->getFileName()) { $data['file_name'] = $object->getFileName(); } - if (null !== $object->getFileSize()) { + if ($object->isInitialized('fileSize') && null !== $object->getFileSize()) { $data['file_size'] = $object->getFileSize(); } - if (null !== $object->getContentType()) { + if ($object->isInitialized('contentType') && null !== $object->getContentType()) { $data['content_type'] = $object->getContentType(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseReportsResultNormalizer.php b/generated/Normalizer/ExpenseReportsResultNormalizer.php index af43af2..26184cb 100644 --- a/generated/Normalizer/ExpenseReportsResultNormalizer.php +++ b/generated/Normalizer/ExpenseReportsResultNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseReportsResultNormalizer implements DenormalizerInterface, Normalize use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult' === \get_class($data); } @@ -52,69 +54,92 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ExpenseReportsResult(); + if (\array_key_exists('total_amount', $data) && \is_int($data['total_amount'])) { + $data['total_amount'] = (float) $data['total_amount']; + } + if (\array_key_exists('billable_amount', $data) && \is_int($data['billable_amount'])) { + $data['billable_amount'] = (float) $data['billable_amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); + unset($data['client_name']); } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); + unset($data['project_name']); } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } if (\array_key_exists('expense_category_id', $data) && null !== $data['expense_category_id']) { $object->setExpenseCategoryId($data['expense_category_id']); + unset($data['expense_category_id']); } elseif (\array_key_exists('expense_category_id', $data) && null === $data['expense_category_id']) { $object->setExpenseCategoryId(null); } if (\array_key_exists('expense_category_name', $data) && null !== $data['expense_category_name']) { $object->setExpenseCategoryName($data['expense_category_name']); + unset($data['expense_category_name']); } elseif (\array_key_exists('expense_category_name', $data) && null === $data['expense_category_name']) { $object->setExpenseCategoryName(null); } if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); + unset($data['user_id']); } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } if (\array_key_exists('user_name', $data) && null !== $data['user_name']) { $object->setUserName($data['user_name']); + unset($data['user_name']); } elseif (\array_key_exists('user_name', $data) && null === $data['user_name']) { $object->setUserName(null); } if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); + unset($data['is_contractor']); } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } if (\array_key_exists('total_amount', $data) && null !== $data['total_amount']) { $object->setTotalAmount($data['total_amount']); + unset($data['total_amount']); } elseif (\array_key_exists('total_amount', $data) && null === $data['total_amount']) { $object->setTotalAmount(null); } if (\array_key_exists('billable_amount', $data) && null !== $data['billable_amount']) { $object->setBillableAmount($data['billable_amount']); + unset($data['billable_amount']); } elseif (\array_key_exists('billable_amount', $data) && null === $data['billable_amount']) { $object->setBillableAmount(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -128,42 +153,47 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getClientName()) { + if ($object->isInitialized('clientName') && null !== $object->getClientName()) { $data['client_name'] = $object->getClientName(); } - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getProjectName()) { + if ($object->isInitialized('projectName') && null !== $object->getProjectName()) { $data['project_name'] = $object->getProjectName(); } - if (null !== $object->getExpenseCategoryId()) { + if ($object->isInitialized('expenseCategoryId') && null !== $object->getExpenseCategoryId()) { $data['expense_category_id'] = $object->getExpenseCategoryId(); } - if (null !== $object->getExpenseCategoryName()) { + if ($object->isInitialized('expenseCategoryName') && null !== $object->getExpenseCategoryName()) { $data['expense_category_name'] = $object->getExpenseCategoryName(); } - if (null !== $object->getUserId()) { + if ($object->isInitialized('userId') && null !== $object->getUserId()) { $data['user_id'] = $object->getUserId(); } - if (null !== $object->getUserName()) { + if ($object->isInitialized('userName') && null !== $object->getUserName()) { $data['user_name'] = $object->getUserName(); } - if (null !== $object->getIsContractor()) { + if ($object->isInitialized('isContractor') && null !== $object->getIsContractor()) { $data['is_contractor'] = $object->getIsContractor(); } - if (null !== $object->getTotalAmount()) { + if ($object->isInitialized('totalAmount') && null !== $object->getTotalAmount()) { $data['total_amount'] = $object->getTotalAmount(); } - if (null !== $object->getBillableAmount()) { + if ($object->isInitialized('billableAmount') && null !== $object->getBillableAmount()) { $data['billable_amount'] = $object->getBillableAmount(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseReportsResultsNormalizer.php b/generated/Normalizer/ExpenseReportsResultsNormalizer.php index c1d5dd1..a465f51 100644 --- a/generated/Normalizer/ExpenseReportsResultsNormalizer.php +++ b/generated/Normalizer/ExpenseReportsResultsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseReportsResultsNormalizer implements DenormalizerInterface, Normaliz use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult', 'json', $context); } $object->setResults($values); + unset($data['results']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ExpenseUserNormalizer.php b/generated/Normalizer/ExpenseUserNormalizer.php index ffdfe98..5547e9d 100644 --- a/generated/Normalizer/ExpenseUserNormalizer.php +++ b/generated/Normalizer/ExpenseUserNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpenseUserNormalizer implements DenormalizerInterface, NormalizerInterfac use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php b/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php index e1c52e3..928d384 100644 --- a/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpensesExpenseIdPatchBodyNormalizer implements DenormalizerInterface, Nor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody' === \get_class($data); } @@ -52,54 +54,71 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody(); + if (\array_key_exists('total_cost', $data) && \is_int($data['total_cost'])) { + $data['total_cost'] = (float) $data['total_cost']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('expense_category_id', $data) && null !== $data['expense_category_id']) { $object->setExpenseCategoryId($data['expense_category_id']); + unset($data['expense_category_id']); } elseif (\array_key_exists('expense_category_id', $data) && null === $data['expense_category_id']) { $object->setExpenseCategoryId(null); } if (\array_key_exists('spent_date', $data) && null !== $data['spent_date']) { $object->setSpentDate(\DateTime::createFromFormat('Y-m-d', $data['spent_date'])->setTime(0, 0, 0)); + unset($data['spent_date']); } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } if (\array_key_exists('units', $data) && null !== $data['units']) { $object->setUnits($data['units']); + unset($data['units']); } elseif (\array_key_exists('units', $data) && null === $data['units']) { $object->setUnits(null); } if (\array_key_exists('total_cost', $data) && null !== $data['total_cost']) { $object->setTotalCost($data['total_cost']); + unset($data['total_cost']); } elseif (\array_key_exists('total_cost', $data) && null === $data['total_cost']) { $object->setTotalCost(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('receipt', $data) && null !== $data['receipt']) { $object->setReceipt($data['receipt']); + unset($data['receipt']); } elseif (\array_key_exists('receipt', $data) && null === $data['receipt']) { $object->setReceipt(null); } if (\array_key_exists('delete_receipt', $data) && null !== $data['delete_receipt']) { $object->setDeleteReceipt($data['delete_receipt']); + unset($data['delete_receipt']); } elseif (\array_key_exists('delete_receipt', $data) && null === $data['delete_receipt']) { $object->setDeleteReceipt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -113,33 +132,38 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getExpenseCategoryId()) { + if ($object->isInitialized('expenseCategoryId') && null !== $object->getExpenseCategoryId()) { $data['expense_category_id'] = $object->getExpenseCategoryId(); } - if (null !== $object->getSpentDate()) { + if ($object->isInitialized('spentDate') && null !== $object->getSpentDate()) { $data['spent_date'] = $object->getSpentDate()->format('Y-m-d'); } - if (null !== $object->getUnits()) { + if ($object->isInitialized('units') && null !== $object->getUnits()) { $data['units'] = $object->getUnits(); } - if (null !== $object->getTotalCost()) { + if ($object->isInitialized('totalCost') && null !== $object->getTotalCost()) { $data['total_cost'] = $object->getTotalCost(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getReceipt()) { + if ($object->isInitialized('receipt') && null !== $object->getReceipt()) { $data['receipt'] = $object->getReceipt(); } - if (null !== $object->getDeleteReceipt()) { + if ($object->isInitialized('deleteReceipt') && null !== $object->getDeleteReceipt()) { $data['delete_receipt'] = $object->getDeleteReceipt(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ExpensesNormalizer.php b/generated/Normalizer/ExpensesNormalizer.php index 9f1bd5c..4d35335 100644 --- a/generated/Normalizer/ExpensesNormalizer.php +++ b/generated/Normalizer/ExpensesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpensesNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Expenses' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Expenses' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json', $context); } $object->setExpenses($values); + unset($data['expenses']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ExpensesPostBodyNormalizer.php b/generated/Normalizer/ExpensesPostBodyNormalizer.php index 1558c21..85ef3ba 100644 --- a/generated/Normalizer/ExpensesPostBodyNormalizer.php +++ b/generated/Normalizer/ExpensesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ExpensesPostBodyNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody' === \get_class($data); } @@ -52,54 +54,71 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ExpensesPostBody(); + if (\array_key_exists('total_cost', $data) && \is_int($data['total_cost'])) { + $data['total_cost'] = (float) $data['total_cost']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); + unset($data['user_id']); } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('expense_category_id', $data) && null !== $data['expense_category_id']) { $object->setExpenseCategoryId($data['expense_category_id']); + unset($data['expense_category_id']); } elseif (\array_key_exists('expense_category_id', $data) && null === $data['expense_category_id']) { $object->setExpenseCategoryId(null); } if (\array_key_exists('spent_date', $data) && null !== $data['spent_date']) { $object->setSpentDate(\DateTime::createFromFormat('Y-m-d', $data['spent_date'])->setTime(0, 0, 0)); + unset($data['spent_date']); } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } if (\array_key_exists('units', $data) && null !== $data['units']) { $object->setUnits($data['units']); + unset($data['units']); } elseif (\array_key_exists('units', $data) && null === $data['units']) { $object->setUnits(null); } if (\array_key_exists('total_cost', $data) && null !== $data['total_cost']) { $object->setTotalCost($data['total_cost']); + unset($data['total_cost']); } elseif (\array_key_exists('total_cost', $data) && null === $data['total_cost']) { $object->setTotalCost(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('receipt', $data) && null !== $data['receipt']) { $object->setReceipt($data['receipt']); + unset($data['receipt']); } elseif (\array_key_exists('receipt', $data) && null === $data['receipt']) { $object->setReceipt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -113,27 +132,32 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getUserId()) { + if ($object->isInitialized('userId') && null !== $object->getUserId()) { $data['user_id'] = $object->getUserId(); } $data['project_id'] = $object->getProjectId(); $data['expense_category_id'] = $object->getExpenseCategoryId(); $data['spent_date'] = $object->getSpentDate()->format('Y-m-d'); - if (null !== $object->getUnits()) { + if ($object->isInitialized('units') && null !== $object->getUnits()) { $data['units'] = $object->getUnits(); } - if (null !== $object->getTotalCost()) { + if ($object->isInitialized('totalCost') && null !== $object->getTotalCost()) { $data['total_cost'] = $object->getTotalCost(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getReceipt()) { + if ($object->isInitialized('receipt') && null !== $object->getReceipt()) { $data['receipt'] = $object->getReceipt(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceClientNormalizer.php b/generated/Normalizer/InvoiceClientNormalizer.php index 9954c1c..6c0ba80 100644 --- a/generated/Normalizer/InvoiceClientNormalizer.php +++ b/generated/Normalizer/InvoiceClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceClientNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceCreatorNormalizer.php b/generated/Normalizer/InvoiceCreatorNormalizer.php index 7bba886..0bb605c 100644 --- a/generated/Normalizer/InvoiceCreatorNormalizer.php +++ b/generated/Normalizer/InvoiceCreatorNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceCreatorNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceEstimateNormalizer.php b/generated/Normalizer/InvoiceEstimateNormalizer.php index 032646c..ef40d77 100644 --- a/generated/Normalizer/InvoiceEstimateNormalizer.php +++ b/generated/Normalizer/InvoiceEstimateNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceEstimateNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -73,9 +81,14 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php b/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php index c299f48..541f91b 100644 --- a/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer implements D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -73,9 +81,14 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceItemCategoriesNormalizer.php b/generated/Normalizer/InvoiceItemCategoriesNormalizer.php index 536d8dc..c6450fb 100644 --- a/generated/Normalizer/InvoiceItemCategoriesNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoriesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceItemCategoriesNormalizer implements DenormalizerInterface, Normaliz use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json', $context); } $object->setInvoiceItemCategories($values); + unset($data['invoice_item_categories']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php b/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php index b917ff9..67e0e1a 100644 --- a/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceItemCategoriesPostBodyNormalizer implements DenormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -74,6 +82,11 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['name'] = $object->getName(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceItemCategoryNormalizer.php b/generated/Normalizer/InvoiceItemCategoryNormalizer.php index 0acfdee..b5d1a85 100644 --- a/generated/Normalizer/InvoiceItemCategoryNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoryNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceItemCategoryNormalizer implements DenormalizerInterface, Normalizer use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory' === \get_class($data); } @@ -57,34 +59,45 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('use_as_service', $data) && null !== $data['use_as_service']) { $object->setUseAsService($data['use_as_service']); + unset($data['use_as_service']); } elseif (\array_key_exists('use_as_service', $data) && null === $data['use_as_service']) { $object->setUseAsService(null); } if (\array_key_exists('use_as_expense', $data) && null !== $data['use_as_expense']) { $object->setUseAsExpense($data['use_as_expense']); + unset($data['use_as_expense']); } elseif (\array_key_exists('use_as_expense', $data) && null === $data['use_as_expense']) { $object->setUseAsExpense(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -98,24 +111,29 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getUseAsService()) { + if ($object->isInitialized('useAsService') && null !== $object->getUseAsService()) { $data['use_as_service'] = $object->getUseAsService(); } - if (null !== $object->getUseAsExpense()) { + if ($object->isInitialized('useAsExpense') && null !== $object->getUseAsExpense()) { $data['use_as_expense'] = $object->getUseAsExpense(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceLineItemNormalizer.php b/generated/Normalizer/InvoiceLineItemNormalizer.php index 135965a..184a080 100644 --- a/generated/Normalizer/InvoiceLineItemNormalizer.php +++ b/generated/Normalizer/InvoiceLineItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceLineItemNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem' === \get_class($data); } @@ -52,54 +54,77 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoiceLineItem(); + if (\array_key_exists('quantity', $data) && \is_int($data['quantity'])) { + $data['quantity'] = (float) $data['quantity']; + } + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject', 'json', $context)); + unset($data['project']); } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } if (\array_key_exists('kind', $data) && null !== $data['kind']) { $object->setKind($data['kind']); + unset($data['kind']); } elseif (\array_key_exists('kind', $data) && null === $data['kind']) { $object->setKind(null); } if (\array_key_exists('description', $data) && null !== $data['description']) { $object->setDescription($data['description']); + unset($data['description']); } elseif (\array_key_exists('description', $data) && null === $data['description']) { $object->setDescription(null); } if (\array_key_exists('quantity', $data) && null !== $data['quantity']) { $object->setQuantity($data['quantity']); + unset($data['quantity']); } elseif (\array_key_exists('quantity', $data) && null === $data['quantity']) { $object->setQuantity(null); } if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('taxed', $data) && null !== $data['taxed']) { $object->setTaxed($data['taxed']); + unset($data['taxed']); } elseif (\array_key_exists('taxed', $data) && null === $data['taxed']) { $object->setTaxed(null); } if (\array_key_exists('taxed2', $data) && null !== $data['taxed2']) { $object->setTaxed2($data['taxed2']); + unset($data['taxed2']); } elseif (\array_key_exists('taxed2', $data) && null === $data['taxed2']) { $object->setTaxed2(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -113,33 +138,38 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getProject()) { + if ($object->isInitialized('project') && null !== $object->getProject()) { $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); } - if (null !== $object->getKind()) { + if ($object->isInitialized('kind') && null !== $object->getKind()) { $data['kind'] = $object->getKind(); } - if (null !== $object->getDescription()) { + if ($object->isInitialized('description') && null !== $object->getDescription()) { $data['description'] = $object->getDescription(); } - if (null !== $object->getQuantity()) { + if ($object->isInitialized('quantity') && null !== $object->getQuantity()) { $data['quantity'] = $object->getQuantity(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getTaxed()) { + if ($object->isInitialized('taxed') && null !== $object->getTaxed()) { $data['taxed'] = $object->getTaxed(); } - if (null !== $object->getTaxed2()) { + if ($object->isInitialized('taxed2') && null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceLineItemProjectNormalizer.php b/generated/Normalizer/InvoiceLineItemProjectNormalizer.php index 1aa0123..cd6ff3a 100644 --- a/generated/Normalizer/InvoiceLineItemProjectNormalizer.php +++ b/generated/Normalizer/InvoiceLineItemProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceLineItemProjectNormalizer implements DenormalizerInterface, Normali use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceLineItemsNormalizer.php b/generated/Normalizer/InvoiceLineItemsNormalizer.php index 4764a71..5b71523 100644 --- a/generated/Normalizer/InvoiceLineItemsNormalizer.php +++ b/generated/Normalizer/InvoiceLineItemsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceLineItemsNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem', 'json', $context); } $object->setInvoiceLineItems($values); + unset($data['invoice_line_items']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceMessageNormalizer.php b/generated/Normalizer/InvoiceMessageNormalizer.php index 8240d78..23543fd 100644 --- a/generated/Normalizer/InvoiceMessageNormalizer.php +++ b/generated/Normalizer/InvoiceMessageNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceMessageNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage' === \get_class($data); } @@ -57,26 +59,31 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('sent_by', $data) && null !== $data['sent_by']) { $object->setSentBy($data['sent_by']); + unset($data['sent_by']); } elseif (\array_key_exists('sent_by', $data) && null === $data['sent_by']) { $object->setSentBy(null); } if (\array_key_exists('sent_by_email', $data) && null !== $data['sent_by_email']) { $object->setSentByEmail($data['sent_by_email']); + unset($data['sent_by_email']); } elseif (\array_key_exists('sent_by_email', $data) && null === $data['sent_by_email']) { $object->setSentByEmail(null); } if (\array_key_exists('sent_from', $data) && null !== $data['sent_from']) { $object->setSentFrom($data['sent_from']); + unset($data['sent_from']); } elseif (\array_key_exists('sent_from', $data) && null === $data['sent_from']) { $object->setSentFrom(null); } if (\array_key_exists('sent_from_email', $data) && null !== $data['sent_from_email']) { $object->setSentFromEmail($data['sent_from_email']); + unset($data['sent_from_email']); } elseif (\array_key_exists('sent_from_email', $data) && null === $data['sent_from_email']) { $object->setSentFromEmail(null); } @@ -86,64 +93,81 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient', 'json', $context); } $object->setRecipients($values); + unset($data['recipients']); } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); + unset($data['body']); } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } if (\array_key_exists('include_link_to_client_invoice', $data) && null !== $data['include_link_to_client_invoice']) { $object->setIncludeLinkToClientInvoice($data['include_link_to_client_invoice']); + unset($data['include_link_to_client_invoice']); } elseif (\array_key_exists('include_link_to_client_invoice', $data) && null === $data['include_link_to_client_invoice']) { $object->setIncludeLinkToClientInvoice(null); } if (\array_key_exists('attach_pdf', $data) && null !== $data['attach_pdf']) { $object->setAttachPdf($data['attach_pdf']); + unset($data['attach_pdf']); } elseif (\array_key_exists('attach_pdf', $data) && null === $data['attach_pdf']) { $object->setAttachPdf(null); } if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); + unset($data['send_me_a_copy']); } elseif (\array_key_exists('send_me_a_copy', $data) && null === $data['send_me_a_copy']) { $object->setSendMeACopy(null); } if (\array_key_exists('thank_you', $data) && null !== $data['thank_you']) { $object->setThankYou($data['thank_you']); + unset($data['thank_you']); } elseif (\array_key_exists('thank_you', $data) && null === $data['thank_you']) { $object->setThankYou(null); } if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); + unset($data['event_type']); } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } if (\array_key_exists('reminder', $data) && null !== $data['reminder']) { $object->setReminder($data['reminder']); + unset($data['reminder']); } elseif (\array_key_exists('reminder', $data) && null === $data['reminder']) { $object->setReminder(null); } if (\array_key_exists('send_reminder_on', $data) && null !== $data['send_reminder_on']) { $object->setSendReminderOn(\DateTime::createFromFormat('Y-m-d', $data['send_reminder_on'])->setTime(0, 0, 0)); + unset($data['send_reminder_on']); } elseif (\array_key_exists('send_reminder_on', $data) && null === $data['send_reminder_on']) { $object->setSendReminderOn(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -157,61 +181,66 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getSentBy()) { + if ($object->isInitialized('sentBy') && null !== $object->getSentBy()) { $data['sent_by'] = $object->getSentBy(); } - if (null !== $object->getSentByEmail()) { + if ($object->isInitialized('sentByEmail') && null !== $object->getSentByEmail()) { $data['sent_by_email'] = $object->getSentByEmail(); } - if (null !== $object->getSentFrom()) { + if ($object->isInitialized('sentFrom') && null !== $object->getSentFrom()) { $data['sent_from'] = $object->getSentFrom(); } - if (null !== $object->getSentFromEmail()) { + if ($object->isInitialized('sentFromEmail') && null !== $object->getSentFromEmail()) { $data['sent_from_email'] = $object->getSentFromEmail(); } - if (null !== $object->getRecipients()) { + if ($object->isInitialized('recipients') && null !== $object->getRecipients()) { $values = []; foreach ($object->getRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['recipients'] = $values; } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getBody()) { + if ($object->isInitialized('body') && null !== $object->getBody()) { $data['body'] = $object->getBody(); } - if (null !== $object->getIncludeLinkToClientInvoice()) { + if ($object->isInitialized('includeLinkToClientInvoice') && null !== $object->getIncludeLinkToClientInvoice()) { $data['include_link_to_client_invoice'] = $object->getIncludeLinkToClientInvoice(); } - if (null !== $object->getAttachPdf()) { + if ($object->isInitialized('attachPdf') && null !== $object->getAttachPdf()) { $data['attach_pdf'] = $object->getAttachPdf(); } - if (null !== $object->getSendMeACopy()) { + if ($object->isInitialized('sendMeACopy') && null !== $object->getSendMeACopy()) { $data['send_me_a_copy'] = $object->getSendMeACopy(); } - if (null !== $object->getThankYou()) { + if ($object->isInitialized('thankYou') && null !== $object->getThankYou()) { $data['thank_you'] = $object->getThankYou(); } - if (null !== $object->getEventType()) { + if ($object->isInitialized('eventType') && null !== $object->getEventType()) { $data['event_type'] = $object->getEventType(); } - if (null !== $object->getReminder()) { + if ($object->isInitialized('reminder') && null !== $object->getReminder()) { $data['reminder'] = $object->getReminder(); } - if (null !== $object->getSendReminderOn()) { + if ($object->isInitialized('sendReminderOn') && null !== $object->getSendReminderOn()) { $data['send_reminder_on'] = $object->getSendReminderOn()->format('Y-m-d'); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceMessageRecipientNormalizer.php b/generated/Normalizer/InvoiceMessageRecipientNormalizer.php index 794e959..1f1e917 100644 --- a/generated/Normalizer/InvoiceMessageRecipientNormalizer.php +++ b/generated/Normalizer/InvoiceMessageRecipientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceMessageRecipientNormalizer implements DenormalizerInterface, Normal use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php b/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php index 33bbf77..b6b1b36 100644 --- a/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php +++ b/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceMessageRecipientsNormalizer implements DenormalizerInterface, Norma use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient', 'json', $context); } $object->setInvoiceMessageRecipients($values); + unset($data['invoice_message_recipients']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceMessageSubjectAndBodyNormalizer.php b/generated/Normalizer/InvoiceMessageSubjectAndBodyNormalizer.php index ae67c27..ab617f9 100644 --- a/generated/Normalizer/InvoiceMessageSubjectAndBodyNormalizer.php +++ b/generated/Normalizer/InvoiceMessageSubjectAndBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceMessageSubjectAndBodyNormalizer implements DenormalizerInterface, N use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageSubjectAndBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageSubjectAndBody' === \get_class($data); } @@ -57,18 +59,28 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('invoice_id', $data)) { $object->setInvoiceId($data['invoice_id']); + unset($data['invoice_id']); } if (\array_key_exists('subject', $data)) { $object->setSubject($data['subject']); + unset($data['subject']); } if (\array_key_exists('body', $data)) { $object->setBody($data['body']); + unset($data['body']); } if (\array_key_exists('reminder', $data)) { $object->setReminder($data['reminder']); + unset($data['reminder']); } if (\array_key_exists('thank_you', $data)) { $object->setThankYou($data['thank_you']); + unset($data['thank_you']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -88,6 +100,11 @@ public function normalize($object, $format = null, array $context = []) $data['body'] = $object->getBody(); $data['reminder'] = $object->getReminder(); $data['thank_you'] = $object->getThankYou(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceMessagesNormalizer.php b/generated/Normalizer/InvoiceMessagesNormalizer.php index 06e29fe..fa63e00 100644 --- a/generated/Normalizer/InvoiceMessagesNormalizer.php +++ b/generated/Normalizer/InvoiceMessagesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceMessagesNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage', 'json', $context); } $object->setInvoiceMessages($values); + unset($data['invoice_messages']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceNormalizer.php b/generated/Normalizer/InvoiceNormalizer.php index 06c27a0..05f75dc 100644 --- a/generated/Normalizer/InvoiceNormalizer.php +++ b/generated/Normalizer/InvoiceNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceNormalizer implements DenormalizerInterface, NormalizerInterface, D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Invoice' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Invoice' === \get_class($data); } @@ -52,16 +54,42 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\Invoice(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } + if (\array_key_exists('due_amount', $data) && \is_int($data['due_amount'])) { + $data['due_amount'] = (float) $data['due_amount']; + } + if (\array_key_exists('tax', $data) && \is_int($data['tax'])) { + $data['tax'] = (float) $data['tax']; + } + if (\array_key_exists('tax_amount', $data) && \is_int($data['tax_amount'])) { + $data['tax_amount'] = (float) $data['tax_amount']; + } + if (\array_key_exists('tax2', $data) && \is_int($data['tax2'])) { + $data['tax2'] = (float) $data['tax2']; + } + if (\array_key_exists('tax2_amount', $data) && \is_int($data['tax2_amount'])) { + $data['tax2_amount'] = (float) $data['tax2_amount']; + } + if (\array_key_exists('discount', $data) && \is_int($data['discount'])) { + $data['discount'] = (float) $data['discount']; + } + if (\array_key_exists('discount_amount', $data) && \is_int($data['discount_amount'])) { + $data['discount_amount'] = (float) $data['discount_amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } @@ -71,159 +99,195 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem', 'json', $context); } $object->setLineItems($values); + unset($data['line_items']); } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } if (\array_key_exists('estimate', $data) && null !== $data['estimate']) { $object->setEstimate($this->denormalizer->denormalize($data['estimate'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate', 'json', $context)); + unset($data['estimate']); } elseif (\array_key_exists('estimate', $data) && null === $data['estimate']) { $object->setEstimate(null); } if (\array_key_exists('retainer', $data) && null !== $data['retainer']) { $object->setRetainer($this->denormalizer->denormalize($data['retainer'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer', 'json', $context)); + unset($data['retainer']); } elseif (\array_key_exists('retainer', $data) && null === $data['retainer']) { $object->setRetainer(null); } if (\array_key_exists('creator', $data) && null !== $data['creator']) { $object->setCreator($this->denormalizer->denormalize($data['creator'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator', 'json', $context)); + unset($data['creator']); } elseif (\array_key_exists('creator', $data) && null === $data['creator']) { $object->setCreator(null); } if (\array_key_exists('client_key', $data) && null !== $data['client_key']) { $object->setClientKey($data['client_key']); + unset($data['client_key']); } elseif (\array_key_exists('client_key', $data) && null === $data['client_key']) { $object->setClientKey(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); + unset($data['purchase_order']); } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('due_amount', $data) && null !== $data['due_amount']) { $object->setDueAmount($data['due_amount']); + unset($data['due_amount']); } elseif (\array_key_exists('due_amount', $data) && null === $data['due_amount']) { $object->setDueAmount(null); } if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); + unset($data['tax']); } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } if (\array_key_exists('tax_amount', $data) && null !== $data['tax_amount']) { $object->setTaxAmount($data['tax_amount']); + unset($data['tax_amount']); } elseif (\array_key_exists('tax_amount', $data) && null === $data['tax_amount']) { $object->setTaxAmount(null); } if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); + unset($data['tax2']); } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } if (\array_key_exists('tax2_amount', $data) && null !== $data['tax2_amount']) { $object->setTax2Amount($data['tax2_amount']); + unset($data['tax2_amount']); } elseif (\array_key_exists('tax2_amount', $data) && null === $data['tax2_amount']) { $object->setTax2Amount(null); } if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); + unset($data['discount']); } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } if (\array_key_exists('discount_amount', $data) && null !== $data['discount_amount']) { $object->setDiscountAmount($data['discount_amount']); + unset($data['discount_amount']); } elseif (\array_key_exists('discount_amount', $data) && null === $data['discount_amount']) { $object->setDiscountAmount(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('state', $data) && null !== $data['state']) { $object->setState($data['state']); + unset($data['state']); } elseif (\array_key_exists('state', $data) && null === $data['state']) { $object->setState(null); } if (\array_key_exists('period_start', $data) && null !== $data['period_start']) { $object->setPeriodStart(\DateTime::createFromFormat('Y-m-d', $data['period_start'])->setTime(0, 0, 0)); + unset($data['period_start']); } elseif (\array_key_exists('period_start', $data) && null === $data['period_start']) { $object->setPeriodStart(null); } if (\array_key_exists('period_end', $data) && null !== $data['period_end']) { $object->setPeriodEnd(\DateTime::createFromFormat('Y-m-d', $data['period_end'])->setTime(0, 0, 0)); + unset($data['period_end']); } elseif (\array_key_exists('period_end', $data) && null === $data['period_end']) { $object->setPeriodEnd(null); } if (\array_key_exists('issue_date', $data) && null !== $data['issue_date']) { $object->setIssueDate(\DateTime::createFromFormat('Y-m-d', $data['issue_date'])->setTime(0, 0, 0)); + unset($data['issue_date']); } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } if (\array_key_exists('due_date', $data) && null !== $data['due_date']) { $object->setDueDate(\DateTime::createFromFormat('Y-m-d', $data['due_date'])->setTime(0, 0, 0)); + unset($data['due_date']); } elseif (\array_key_exists('due_date', $data) && null === $data['due_date']) { $object->setDueDate(null); } if (\array_key_exists('payment_term', $data) && null !== $data['payment_term']) { $object->setPaymentTerm($data['payment_term']); + unset($data['payment_term']); } elseif (\array_key_exists('payment_term', $data) && null === $data['payment_term']) { $object->setPaymentTerm(null); } if (\array_key_exists('sent_at', $data) && null !== $data['sent_at']) { $object->setSentAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['sent_at'])); + unset($data['sent_at']); } elseif (\array_key_exists('sent_at', $data) && null === $data['sent_at']) { $object->setSentAt(null); } if (\array_key_exists('paid_at', $data) && null !== $data['paid_at']) { $object->setPaidAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['paid_at'])); + unset($data['paid_at']); } elseif (\array_key_exists('paid_at', $data) && null === $data['paid_at']) { $object->setPaidAt(null); } if (\array_key_exists('paid_date', $data) && null !== $data['paid_date']) { $object->setPaidDate(\DateTime::createFromFormat('Y-m-d', $data['paid_date'])->setTime(0, 0, 0)); + unset($data['paid_date']); } elseif (\array_key_exists('paid_date', $data) && null === $data['paid_date']) { $object->setPaidDate(null); } if (\array_key_exists('closed_at', $data) && null !== $data['closed_at']) { $object->setClosedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['closed_at'])); + unset($data['closed_at']); } elseif (\array_key_exists('closed_at', $data) && null === $data['closed_at']) { $object->setClosedAt(null); } if (\array_key_exists('recurring_invoice_id', $data) && null !== $data['recurring_invoice_id']) { $object->setRecurringInvoiceId($data['recurring_invoice_id']); + unset($data['recurring_invoice_id']); } elseif (\array_key_exists('recurring_invoice_id', $data) && null === $data['recurring_invoice_id']) { $object->setRecurringInvoiceId(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -237,109 +301,114 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getLineItems()) { + if ($object->isInitialized('lineItems') && null !== $object->getLineItems()) { $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } - if (null !== $object->getEstimate()) { + if ($object->isInitialized('estimate') && null !== $object->getEstimate()) { $data['estimate'] = $this->normalizer->normalize($object->getEstimate(), 'json', $context); } - if (null !== $object->getRetainer()) { + if ($object->isInitialized('retainer') && null !== $object->getRetainer()) { $data['retainer'] = $this->normalizer->normalize($object->getRetainer(), 'json', $context); } - if (null !== $object->getCreator()) { + if ($object->isInitialized('creator') && null !== $object->getCreator()) { $data['creator'] = $this->normalizer->normalize($object->getCreator(), 'json', $context); } - if (null !== $object->getClientKey()) { + if ($object->isInitialized('clientKey') && null !== $object->getClientKey()) { $data['client_key'] = $object->getClientKey(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } - if (null !== $object->getPurchaseOrder()) { + if ($object->isInitialized('purchaseOrder') && null !== $object->getPurchaseOrder()) { $data['purchase_order'] = $object->getPurchaseOrder(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getDueAmount()) { + if ($object->isInitialized('dueAmount') && null !== $object->getDueAmount()) { $data['due_amount'] = $object->getDueAmount(); } - if (null !== $object->getTax()) { + if ($object->isInitialized('tax') && null !== $object->getTax()) { $data['tax'] = $object->getTax(); } - if (null !== $object->getTaxAmount()) { + if ($object->isInitialized('taxAmount') && null !== $object->getTaxAmount()) { $data['tax_amount'] = $object->getTaxAmount(); } - if (null !== $object->getTax2()) { + if ($object->isInitialized('tax2') && null !== $object->getTax2()) { $data['tax2'] = $object->getTax2(); } - if (null !== $object->getTax2Amount()) { + if ($object->isInitialized('tax2Amount') && null !== $object->getTax2Amount()) { $data['tax2_amount'] = $object->getTax2Amount(); } - if (null !== $object->getDiscount()) { + if ($object->isInitialized('discount') && null !== $object->getDiscount()) { $data['discount'] = $object->getDiscount(); } - if (null !== $object->getDiscountAmount()) { + if ($object->isInitialized('discountAmount') && null !== $object->getDiscountAmount()) { $data['discount_amount'] = $object->getDiscountAmount(); } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getState()) { + if ($object->isInitialized('state') && null !== $object->getState()) { $data['state'] = $object->getState(); } - if (null !== $object->getPeriodStart()) { + if ($object->isInitialized('periodStart') && null !== $object->getPeriodStart()) { $data['period_start'] = $object->getPeriodStart()->format('Y-m-d'); } - if (null !== $object->getPeriodEnd()) { + if ($object->isInitialized('periodEnd') && null !== $object->getPeriodEnd()) { $data['period_end'] = $object->getPeriodEnd()->format('Y-m-d'); } - if (null !== $object->getIssueDate()) { + if ($object->isInitialized('issueDate') && null !== $object->getIssueDate()) { $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } - if (null !== $object->getDueDate()) { + if ($object->isInitialized('dueDate') && null !== $object->getDueDate()) { $data['due_date'] = $object->getDueDate()->format('Y-m-d'); } - if (null !== $object->getPaymentTerm()) { + if ($object->isInitialized('paymentTerm') && null !== $object->getPaymentTerm()) { $data['payment_term'] = $object->getPaymentTerm(); } - if (null !== $object->getSentAt()) { + if ($object->isInitialized('sentAt') && null !== $object->getSentAt()) { $data['sent_at'] = $object->getSentAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getPaidAt()) { + if ($object->isInitialized('paidAt') && null !== $object->getPaidAt()) { $data['paid_at'] = $object->getPaidAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getPaidDate()) { + if ($object->isInitialized('paidDate') && null !== $object->getPaidDate()) { $data['paid_date'] = $object->getPaidDate()->format('Y-m-d'); } - if (null !== $object->getClosedAt()) { + if ($object->isInitialized('closedAt') && null !== $object->getClosedAt()) { $data['closed_at'] = $object->getClosedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getRecurringInvoiceId()) { + if ($object->isInitialized('recurringInvoiceId') && null !== $object->getRecurringInvoiceId()) { $data['recurring_invoice_id'] = $object->getRecurringInvoiceId(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoicePaymentNormalizer.php b/generated/Normalizer/InvoicePaymentNormalizer.php index 6f22c75..a190ed3 100644 --- a/generated/Normalizer/InvoicePaymentNormalizer.php +++ b/generated/Normalizer/InvoicePaymentNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicePaymentNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment' === \get_class($data); } @@ -52,64 +54,83 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoicePayment(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('paid_at', $data) && null !== $data['paid_at']) { $object->setPaidAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['paid_at'])); + unset($data['paid_at']); } elseif (\array_key_exists('paid_at', $data) && null === $data['paid_at']) { $object->setPaidAt(null); } if (\array_key_exists('paid_date', $data) && null !== $data['paid_date']) { $object->setPaidDate(\DateTime::createFromFormat('Y-m-d', $data['paid_date'])->setTime(0, 0, 0)); + unset($data['paid_date']); } elseif (\array_key_exists('paid_date', $data) && null === $data['paid_date']) { $object->setPaidDate(null); } if (\array_key_exists('recorded_by', $data) && null !== $data['recorded_by']) { $object->setRecordedBy($data['recorded_by']); + unset($data['recorded_by']); } elseif (\array_key_exists('recorded_by', $data) && null === $data['recorded_by']) { $object->setRecordedBy(null); } if (\array_key_exists('recorded_by_email', $data) && null !== $data['recorded_by_email']) { $object->setRecordedByEmail($data['recorded_by_email']); + unset($data['recorded_by_email']); } elseif (\array_key_exists('recorded_by_email', $data) && null === $data['recorded_by_email']) { $object->setRecordedByEmail(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('transaction_id', $data) && null !== $data['transaction_id']) { $object->setTransactionId($data['transaction_id']); + unset($data['transaction_id']); } elseif (\array_key_exists('transaction_id', $data) && null === $data['transaction_id']) { $object->setTransactionId(null); } if (\array_key_exists('payment_gateway', $data) && null !== $data['payment_gateway']) { $object->setPaymentGateway($this->denormalizer->denormalize($data['payment_gateway'], 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway', 'json', $context)); + unset($data['payment_gateway']); } elseif (\array_key_exists('payment_gateway', $data) && null === $data['payment_gateway']) { $object->setPaymentGateway(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -123,39 +144,44 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getAmount()) { + if ($object->isInitialized('amount') && null !== $object->getAmount()) { $data['amount'] = $object->getAmount(); } - if (null !== $object->getPaidAt()) { + if ($object->isInitialized('paidAt') && null !== $object->getPaidAt()) { $data['paid_at'] = $object->getPaidAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getPaidDate()) { + if ($object->isInitialized('paidDate') && null !== $object->getPaidDate()) { $data['paid_date'] = $object->getPaidDate()->format('Y-m-d'); } - if (null !== $object->getRecordedBy()) { + if ($object->isInitialized('recordedBy') && null !== $object->getRecordedBy()) { $data['recorded_by'] = $object->getRecordedBy(); } - if (null !== $object->getRecordedByEmail()) { + if ($object->isInitialized('recordedByEmail') && null !== $object->getRecordedByEmail()) { $data['recorded_by_email'] = $object->getRecordedByEmail(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getTransactionId()) { + if ($object->isInitialized('transactionId') && null !== $object->getTransactionId()) { $data['transaction_id'] = $object->getTransactionId(); } - if (null !== $object->getPaymentGateway()) { + if ($object->isInitialized('paymentGateway') && null !== $object->getPaymentGateway()) { $data['payment_gateway'] = $this->normalizer->normalize($object->getPaymentGateway(), 'json', $context); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php b/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php index 54f5d24..523fa40 100644 --- a/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php +++ b/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicePaymentPaymentGatewayNormalizer implements DenormalizerInterface, N use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicePaymentsNormalizer.php b/generated/Normalizer/InvoicePaymentsNormalizer.php index edf9079..c053019 100644 --- a/generated/Normalizer/InvoicePaymentsNormalizer.php +++ b/generated/Normalizer/InvoicePaymentsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicePaymentsNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment', 'json', $context); } $object->setInvoicePayments($values); + unset($data['invoice_payments']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoiceRetainerNormalizer.php b/generated/Normalizer/InvoiceRetainerNormalizer.php index b70835d..0f749a8 100644 --- a/generated/Normalizer/InvoiceRetainerNormalizer.php +++ b/generated/Normalizer/InvoiceRetainerNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoiceRetainerNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -73,9 +81,14 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php index 6c2f4e3..eeabece 100644 --- a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesInvoiceIdMessagesPostBodyNormalizer implements DenormalizerInterfa use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody' === \get_class($data); } @@ -57,6 +59,7 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); + unset($data['event_type']); } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } @@ -66,39 +69,51 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem', 'json', $context); } $object->setRecipients($values); + unset($data['recipients']); } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); + unset($data['body']); } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } if (\array_key_exists('include_link_to_client_invoice', $data) && null !== $data['include_link_to_client_invoice']) { $object->setIncludeLinkToClientInvoice($data['include_link_to_client_invoice']); + unset($data['include_link_to_client_invoice']); } elseif (\array_key_exists('include_link_to_client_invoice', $data) && null === $data['include_link_to_client_invoice']) { $object->setIncludeLinkToClientInvoice(null); } if (\array_key_exists('attach_pdf', $data) && null !== $data['attach_pdf']) { $object->setAttachPdf($data['attach_pdf']); + unset($data['attach_pdf']); } elseif (\array_key_exists('attach_pdf', $data) && null === $data['attach_pdf']) { $object->setAttachPdf(null); } if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); + unset($data['send_me_a_copy']); } elseif (\array_key_exists('send_me_a_copy', $data) && null === $data['send_me_a_copy']) { $object->setSendMeACopy(null); } if (\array_key_exists('thank_you', $data) && null !== $data['thank_you']) { $object->setThankYou($data['thank_you']); + unset($data['thank_you']); } elseif (\array_key_exists('thank_you', $data) && null === $data['thank_you']) { $object->setThankYou(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -112,7 +127,7 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getEventType()) { + if ($object->isInitialized('eventType') && null !== $object->getEventType()) { $data['event_type'] = $object->getEventType(); } $values = []; @@ -120,24 +135,29 @@ public function normalize($object, $format = null, array $context = []) $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['recipients'] = $values; - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getBody()) { + if ($object->isInitialized('body') && null !== $object->getBody()) { $data['body'] = $object->getBody(); } - if (null !== $object->getIncludeLinkToClientInvoice()) { + if ($object->isInitialized('includeLinkToClientInvoice') && null !== $object->getIncludeLinkToClientInvoice()) { $data['include_link_to_client_invoice'] = $object->getIncludeLinkToClientInvoice(); } - if (null !== $object->getAttachPdf()) { + if ($object->isInitialized('attachPdf') && null !== $object->getAttachPdf()) { $data['attach_pdf'] = $object->getAttachPdf(); } - if (null !== $object->getSendMeACopy()) { + if ($object->isInitialized('sendMeACopy') && null !== $object->getSendMeACopy()) { $data['send_me_a_copy'] = $object->getSendMeACopy(); } - if (null !== $object->getThankYou()) { + if ($object->isInitialized('thankYou') && null !== $object->getThankYou()) { $data['thank_you'] = $object->getThankYou(); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php index 6c7bd43..7f00ddc 100644 --- a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer implements Denor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem' === \get_class($data); } @@ -57,9 +59,16 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data)) { $object->setName($data['name']); + unset($data['name']); } if (\array_key_exists('email', $data)) { $object->setEmail($data['email']); + unset($data['email']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -74,10 +83,15 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } $data['email'] = $object->getEmail(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php index 6c8b609..52235e4 100644 --- a/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer implements DenormalizerI use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem' === \get_class($data); } @@ -52,32 +54,51 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBodyLineItemsItem(); + if (\array_key_exists('quantity', $data) && \is_int($data['quantity'])) { + $data['quantity'] = (float) $data['quantity']; + } + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data)) { $object->setId($data['id']); + unset($data['id']); } if (\array_key_exists('project_id', $data)) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } if (\array_key_exists('kind', $data)) { $object->setKind($data['kind']); + unset($data['kind']); } if (\array_key_exists('description', $data)) { $object->setDescription($data['description']); + unset($data['description']); } if (\array_key_exists('quantity', $data)) { $object->setQuantity($data['quantity']); + unset($data['quantity']); } if (\array_key_exists('unit_price', $data)) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } if (\array_key_exists('taxed', $data)) { $object->setTaxed($data['taxed']); + unset($data['taxed']); } if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); + unset($data['taxed2']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -92,30 +113,35 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getKind()) { + if ($object->isInitialized('kind') && null !== $object->getKind()) { $data['kind'] = $object->getKind(); } - if (null !== $object->getDescription()) { + if ($object->isInitialized('description') && null !== $object->getDescription()) { $data['description'] = $object->getDescription(); } - if (null !== $object->getQuantity()) { + if ($object->isInitialized('quantity') && null !== $object->getQuantity()) { $data['quantity'] = $object->getQuantity(); } - if (null !== $object->getUnitPrice()) { + if ($object->isInitialized('unitPrice') && null !== $object->getUnitPrice()) { $data['unit_price'] = $object->getUnitPrice(); } - if (null !== $object->getTaxed()) { + if ($object->isInitialized('taxed') && null !== $object->getTaxed()) { $data['taxed'] = $object->getTaxed(); } - if (null !== $object->getTaxed2()) { + if ($object->isInitialized('taxed2') && null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php index d6bb0f8..5f0074b 100644 --- a/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesInvoiceIdPatchBodyNormalizer implements DenormalizerInterface, Nor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody' === \get_class($data); } @@ -52,76 +54,99 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody(); + if (\array_key_exists('tax', $data) && \is_int($data['tax'])) { + $data['tax'] = (float) $data['tax']; + } + if (\array_key_exists('tax2', $data) && \is_int($data['tax2'])) { + $data['tax2'] = (float) $data['tax2']; + } + if (\array_key_exists('discount', $data) && \is_int($data['discount'])) { + $data['discount'] = (float) $data['discount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('retainer_id', $data) && null !== $data['retainer_id']) { $object->setRetainerId($data['retainer_id']); + unset($data['retainer_id']); } elseif (\array_key_exists('retainer_id', $data) && null === $data['retainer_id']) { $object->setRetainerId(null); } if (\array_key_exists('estimate_id', $data) && null !== $data['estimate_id']) { $object->setEstimateId($data['estimate_id']); + unset($data['estimate_id']); } elseif (\array_key_exists('estimate_id', $data) && null === $data['estimate_id']) { $object->setEstimateId(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); + unset($data['purchase_order']); } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); + unset($data['tax']); } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); + unset($data['tax2']); } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); + unset($data['discount']); } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('issue_date', $data) && null !== $data['issue_date']) { $object->setIssueDate(\DateTime::createFromFormat('Y-m-d', $data['issue_date'])->setTime(0, 0, 0)); + unset($data['issue_date']); } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } if (\array_key_exists('due_date', $data) && null !== $data['due_date']) { $object->setDueDate(\DateTime::createFromFormat('Y-m-d', $data['due_date'])->setTime(0, 0, 0)); + unset($data['due_date']); } elseif (\array_key_exists('due_date', $data) && null === $data['due_date']) { $object->setDueDate(null); } if (\array_key_exists('payment_term', $data) && null !== $data['payment_term']) { $object->setPaymentTerm($data['payment_term']); + unset($data['payment_term']); } elseif (\array_key_exists('payment_term', $data) && null === $data['payment_term']) { $object->setPaymentTerm(null); } @@ -131,9 +156,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); + unset($data['line_items']); } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -147,55 +178,60 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getRetainerId()) { + if ($object->isInitialized('retainerId') && null !== $object->getRetainerId()) { $data['retainer_id'] = $object->getRetainerId(); } - if (null !== $object->getEstimateId()) { + if ($object->isInitialized('estimateId') && null !== $object->getEstimateId()) { $data['estimate_id'] = $object->getEstimateId(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } - if (null !== $object->getPurchaseOrder()) { + if ($object->isInitialized('purchaseOrder') && null !== $object->getPurchaseOrder()) { $data['purchase_order'] = $object->getPurchaseOrder(); } - if (null !== $object->getTax()) { + if ($object->isInitialized('tax') && null !== $object->getTax()) { $data['tax'] = $object->getTax(); } - if (null !== $object->getTax2()) { + if ($object->isInitialized('tax2') && null !== $object->getTax2()) { $data['tax2'] = $object->getTax2(); } - if (null !== $object->getDiscount()) { + if ($object->isInitialized('discount') && null !== $object->getDiscount()) { $data['discount'] = $object->getDiscount(); } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getIssueDate()) { + if ($object->isInitialized('issueDate') && null !== $object->getIssueDate()) { $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } - if (null !== $object->getDueDate()) { + if ($object->isInitialized('dueDate') && null !== $object->getDueDate()) { $data['due_date'] = $object->getDueDate()->format('Y-m-d'); } - if (null !== $object->getPaymentTerm()) { + if ($object->isInitialized('paymentTerm') && null !== $object->getPaymentTerm()) { $data['payment_term'] = $object->getPaymentTerm(); } - if (null !== $object->getLineItems()) { + if ($object->isInitialized('lineItems') && null !== $object->getLineItems()) { $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php index 521b694..cb87069 100644 --- a/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesInvoiceIdPaymentsPostBodyNormalizer implements DenormalizerInterfa use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody' === \get_class($data); } @@ -52,29 +54,41 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('paid_at', $data) && null !== $data['paid_at']) { $object->setPaidAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['paid_at'])); + unset($data['paid_at']); } elseif (\array_key_exists('paid_at', $data) && null === $data['paid_at']) { $object->setPaidAt(null); } if (\array_key_exists('paid_date', $data) && null !== $data['paid_date']) { $object->setPaidDate(\DateTime::createFromFormat('Y-m-d', $data['paid_date'])->setTime(0, 0, 0)); + unset($data['paid_date']); } elseif (\array_key_exists('paid_date', $data) && null === $data['paid_date']) { $object->setPaidDate(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -89,15 +103,20 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['amount'] = $object->getAmount(); - if (null !== $object->getPaidAt()) { + if ($object->isInitialized('paidAt') && null !== $object->getPaidAt()) { $data['paid_at'] = $object->getPaidAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getPaidDate()) { + if ($object->isInitialized('paidDate') && null !== $object->getPaidDate()) { $data['paid_date'] = $object->getPaidDate()->format('Y-m-d'); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesNormalizer.php b/generated/Normalizer/InvoicesNormalizer.php index 2227b0c..459a3da 100644 --- a/generated/Normalizer/InvoicesNormalizer.php +++ b/generated/Normalizer/InvoicesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Invoices' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Invoices' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json', $context); } $object->setInvoices($values); + unset($data['invoices']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php index ecd1836..07289f1 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesPostBodyLineItemsImportExpensesNormalizer implements DenormalizerI use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses' === \get_class($data); } @@ -57,15 +59,24 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('summary_type', $data)) { $object->setSummaryType($data['summary_type']); + unset($data['summary_type']); } if (\array_key_exists('from', $data)) { $object->setFrom(\DateTime::createFromFormat('Y-m-d', $data['from'])->setTime(0, 0, 0)); + unset($data['from']); } if (\array_key_exists('to', $data)) { $object->setTo(\DateTime::createFromFormat('Y-m-d', $data['to'])->setTime(0, 0, 0)); + unset($data['to']); } if (\array_key_exists('attach_receipt', $data)) { $object->setAttachReceipt($data['attach_receipt']); + unset($data['attach_receipt']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -81,15 +92,20 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['summary_type'] = $object->getSummaryType(); - if (null !== $object->getFrom()) { + if ($object->isInitialized('from') && null !== $object->getFrom()) { $data['from'] = $object->getFrom()->format('Y-m-d'); } - if (null !== $object->getTo()) { + if ($object->isInitialized('to') && null !== $object->getTo()) { $data['to'] = $object->getTo()->format('Y-m-d'); } - if (null !== $object->getAttachReceipt()) { + if ($object->isInitialized('attachReceipt') && null !== $object->getAttachReceipt()) { $data['attach_receipt'] = $object->getAttachReceipt(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php index 1f7514e..68d63be 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesPostBodyLineItemsImportNormalizer implements DenormalizerInterface use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport' === \get_class($data); } @@ -61,12 +63,20 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setProjectIds($values); + unset($data['project_ids']); } if (\array_key_exists('time', $data)) { $object->setTime($this->denormalizer->denormalize($data['time'], 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime', 'json', $context)); + unset($data['time']); } if (\array_key_exists('expenses', $data)) { $object->setExpenses($this->denormalizer->denormalize($data['expenses'], 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses', 'json', $context)); + unset($data['expenses']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -86,12 +96,17 @@ public function normalize($object, $format = null, array $context = []) $values[] = $value; } $data['project_ids'] = $values; - if (null !== $object->getTime()) { + if ($object->isInitialized('time') && null !== $object->getTime()) { $data['time'] = $this->normalizer->normalize($object->getTime(), 'json', $context); } - if (null !== $object->getExpenses()) { + if ($object->isInitialized('expenses') && null !== $object->getExpenses()) { $data['expenses'] = $this->normalizer->normalize($object->getExpenses(), 'json', $context); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php index 091dc84..3ffec66 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesPostBodyLineItemsImportTimeNormalizer implements DenormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime' === \get_class($data); } @@ -57,12 +59,20 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('summary_type', $data)) { $object->setSummaryType($data['summary_type']); + unset($data['summary_type']); } if (\array_key_exists('from', $data)) { $object->setFrom(\DateTime::createFromFormat('Y-m-d', $data['from'])->setTime(0, 0, 0)); + unset($data['from']); } if (\array_key_exists('to', $data)) { $object->setTo(\DateTime::createFromFormat('Y-m-d', $data['to'])->setTime(0, 0, 0)); + unset($data['to']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -78,12 +88,17 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['summary_type'] = $object->getSummaryType(); - if (null !== $object->getFrom()) { + if ($object->isInitialized('from') && null !== $object->getFrom()) { $data['from'] = $object->getFrom()->format('Y-m-d'); } - if (null !== $object->getTo()) { + if ($object->isInitialized('to') && null !== $object->getTo()) { $data['to'] = $object->getTo()->format('Y-m-d'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php index 83dbe8f..c7a4d6e 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesPostBodyLineItemsItemNormalizer implements DenormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem' === \get_class($data); } @@ -52,29 +54,47 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoicesPostBodyLineItemsItem(); + if (\array_key_exists('quantity', $data) && \is_int($data['quantity'])) { + $data['quantity'] = (float) $data['quantity']; + } + if (\array_key_exists('unit_price', $data) && \is_int($data['unit_price'])) { + $data['unit_price'] = (float) $data['unit_price']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('project_id', $data)) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } if (\array_key_exists('kind', $data)) { $object->setKind($data['kind']); + unset($data['kind']); } if (\array_key_exists('description', $data)) { $object->setDescription($data['description']); + unset($data['description']); } if (\array_key_exists('quantity', $data)) { $object->setQuantity($data['quantity']); + unset($data['quantity']); } if (\array_key_exists('unit_price', $data)) { $object->setUnitPrice($data['unit_price']); + unset($data['unit_price']); } if (\array_key_exists('taxed', $data)) { $object->setTaxed($data['taxed']); + unset($data['taxed']); } if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); + unset($data['taxed2']); + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } } return $object; @@ -89,23 +109,28 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } $data['kind'] = $object->getKind(); - if (null !== $object->getDescription()) { + if ($object->isInitialized('description') && null !== $object->getDescription()) { $data['description'] = $object->getDescription(); } - if (null !== $object->getQuantity()) { + if ($object->isInitialized('quantity') && null !== $object->getQuantity()) { $data['quantity'] = $object->getQuantity(); } $data['unit_price'] = $object->getUnitPrice(); - if (null !== $object->getTaxed()) { + if ($object->isInitialized('taxed') && null !== $object->getTaxed()) { $data['taxed'] = $object->getTaxed(); } - if (null !== $object->getTaxed2()) { + if ($object->isInitialized('taxed2') && null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/InvoicesPostBodyNormalizer.php b/generated/Normalizer/InvoicesPostBodyNormalizer.php index 5752ca0..af98673 100644 --- a/generated/Normalizer/InvoicesPostBodyNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class InvoicesPostBodyNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody' === \get_class($data); } @@ -52,93 +54,123 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\InvoicesPostBody(); + if (\array_key_exists('tax', $data) && \is_int($data['tax'])) { + $data['tax'] = (float) $data['tax']; + } + if (\array_key_exists('tax2', $data) && \is_int($data['tax2'])) { + $data['tax2'] = (float) $data['tax2']; + } + if (\array_key_exists('discount', $data) && \is_int($data['discount'])) { + $data['discount'] = (float) $data['discount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('retainer_id', $data) && null !== $data['retainer_id']) { - $object->setRetainerId($data['retainer_id']); - } elseif (\array_key_exists('retainer_id', $data) && null === $data['retainer_id']) { - $object->setRetainerId(null); - } if (\array_key_exists('estimate_id', $data) && null !== $data['estimate_id']) { $object->setEstimateId($data['estimate_id']); + unset($data['estimate_id']); } elseif (\array_key_exists('estimate_id', $data) && null === $data['estimate_id']) { $object->setEstimateId(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); + unset($data['purchase_order']); } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); + unset($data['tax']); } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); + unset($data['tax2']); } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); + unset($data['discount']); } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); + unset($data['subject']); } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('issue_date', $data) && null !== $data['issue_date']) { $object->setIssueDate(\DateTime::createFromFormat('Y-m-d', $data['issue_date'])->setTime(0, 0, 0)); + unset($data['issue_date']); } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } if (\array_key_exists('due_date', $data) && null !== $data['due_date']) { $object->setDueDate(\DateTime::createFromFormat('Y-m-d', $data['due_date'])->setTime(0, 0, 0)); + unset($data['due_date']); } elseif (\array_key_exists('due_date', $data) && null === $data['due_date']) { $object->setDueDate(null); } if (\array_key_exists('payment_term', $data) && null !== $data['payment_term']) { $object->setPaymentTerm($data['payment_term']); + unset($data['payment_term']); } elseif (\array_key_exists('payment_term', $data) && null === $data['payment_term']) { $object->setPaymentTerm(null); } if (\array_key_exists('line_items_import', $data) && null !== $data['line_items_import']) { $object->setLineItemsImport($this->denormalizer->denormalize($data['line_items_import'], 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport', 'json', $context)); + unset($data['line_items_import']); } elseif (\array_key_exists('line_items_import', $data) && null === $data['line_items_import']) { $object->setLineItemsImport(null); } + if (\array_key_exists('retainer_id', $data) && null !== $data['retainer_id']) { + $object->setRetainerId($data['retainer_id']); + unset($data['retainer_id']); + } elseif (\array_key_exists('retainer_id', $data) && null === $data['retainer_id']) { + $object->setRetainerId(null); + } if (\array_key_exists('line_items', $data) && null !== $data['line_items']) { $values = []; foreach ($data['line_items'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); + unset($data['line_items']); } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -153,55 +185,60 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['client_id'] = $object->getClientId(); - if (null !== $object->getRetainerId()) { - $data['retainer_id'] = $object->getRetainerId(); - } - if (null !== $object->getEstimateId()) { + if ($object->isInitialized('estimateId') && null !== $object->getEstimateId()) { $data['estimate_id'] = $object->getEstimateId(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } - if (null !== $object->getPurchaseOrder()) { + if ($object->isInitialized('purchaseOrder') && null !== $object->getPurchaseOrder()) { $data['purchase_order'] = $object->getPurchaseOrder(); } - if (null !== $object->getTax()) { + if ($object->isInitialized('tax') && null !== $object->getTax()) { $data['tax'] = $object->getTax(); } - if (null !== $object->getTax2()) { + if ($object->isInitialized('tax2') && null !== $object->getTax2()) { $data['tax2'] = $object->getTax2(); } - if (null !== $object->getDiscount()) { + if ($object->isInitialized('discount') && null !== $object->getDiscount()) { $data['discount'] = $object->getDiscount(); } - if (null !== $object->getSubject()) { + if ($object->isInitialized('subject') && null !== $object->getSubject()) { $data['subject'] = $object->getSubject(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getIssueDate()) { + if ($object->isInitialized('issueDate') && null !== $object->getIssueDate()) { $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } - if (null !== $object->getDueDate()) { + if ($object->isInitialized('dueDate') && null !== $object->getDueDate()) { $data['due_date'] = $object->getDueDate()->format('Y-m-d'); } - if (null !== $object->getPaymentTerm()) { + if ($object->isInitialized('paymentTerm') && null !== $object->getPaymentTerm()) { $data['payment_term'] = $object->getPaymentTerm(); } - if (null !== $object->getLineItemsImport()) { + if ($object->isInitialized('lineItemsImport') && null !== $object->getLineItemsImport()) { $data['line_items_import'] = $this->normalizer->normalize($object->getLineItemsImport(), 'json', $context); } - if (null !== $object->getLineItems()) { + if ($object->isInitialized('retainerId') && null !== $object->getRetainerId()) { + $data['retainer_id'] = $object->getRetainerId(); + } + if ($object->isInitialized('lineItems') && null !== $object->getLineItems()) { $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/JaneObjectNormalizer.php b/generated/Normalizer/JaneObjectNormalizer.php index 7a25b34..9210bfe 100644 --- a/generated/Normalizer/JaneObjectNormalizer.php +++ b/generated/Normalizer/JaneObjectNormalizer.php @@ -12,6 +12,7 @@ namespace JoliCode\Harvest\Api\Normalizer; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -24,15 +25,16 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; protected $normalizers = ['JoliCode\\Harvest\\Api\\Model\\Contact' => 'JoliCode\\Harvest\\Api\\Normalizer\\ContactNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ContactClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\ContactClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Client' => 'JoliCode\\Harvest\\Api\\Normalizer\\ClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Company' => 'JoliCode\\Harvest\\Api\\Normalizer\\CompanyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceMessageNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceMessageRecipientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicePaymentNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicePaymentPaymentGatewayNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Invoice' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceEstimateNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceRetainerNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceCreatorNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceLineItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceLineItemProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceItemCategoryNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateMessageNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateMessageRecipientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Estimate' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateCreatorNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateLineItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateItemCategoryNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Expense' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseExpenseCategoryNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseUserNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseReceiptNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseInvoiceNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseCategoryNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Task' => 'JoliCode\\Harvest\\Api\\Normalizer\\TaskNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntry' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryUserNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryTaskNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryExternalReferenceNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntryInvoiceNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UserAssignment' => 'JoliCode\\Harvest\\Api\\Normalizer\\UserAssignmentNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject' => 'JoliCode\\Harvest\\Api\\Normalizer\\UserAssignmentProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser' => 'JoliCode\\Harvest\\Api\\Normalizer\\UserAssignmentUserNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment' => 'JoliCode\\Harvest\\Api\\Normalizer\\TaskAssignmentNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject' => 'JoliCode\\Harvest\\Api\\Normalizer\\TaskAssignmentProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask' => 'JoliCode\\Harvest\\Api\\Normalizer\\TaskAssignmentTaskNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Project' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Role' => 'JoliCode\\Harvest\\Api\\Normalizer\\RoleNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Teammate' => 'JoliCode\\Harvest\\Api\\Normalizer\\TeammateNormalizer', 'JoliCode\\Harvest\\Api\\Model\\BillableRate' => 'JoliCode\\Harvest\\Api\\Normalizer\\BillableRateNormalizer', 'JoliCode\\Harvest\\Api\\Model\\CostRate' => 'JoliCode\\Harvest\\Api\\Normalizer\\CostRateNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectAssignmentNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectAssignmentProjectNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectAssignmentClientNormalizer', 'JoliCode\\Harvest\\Api\\Model\\User' => 'JoliCode\\Harvest\\Api\\Normalizer\\UserNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseReportsResultNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult' => 'JoliCode\\Harvest\\Api\\Normalizer\\UninvoicedReportResultNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeReportsResultNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectBudgetReportResultNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Contacts' => 'JoliCode\\Harvest\\Api\\Normalizer\\ContactsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Clients' => 'JoliCode\\Harvest\\Api\\Normalizer\\ClientsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Companies' => 'JoliCode\\Harvest\\Api\\Normalizer\\CompaniesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceMessagesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceMessageRecipientsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicePaymentsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Invoices' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceLineItemsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceItemCategoriesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateMessagesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateMessageRecipientsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Estimates' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateLineItemsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateItemCategoriesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Expenses' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpensesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseCategoriesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Tasks' => 'JoliCode\\Harvest\\Api\\Normalizer\\TasksNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntries' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntriesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UserAssignments' => 'JoliCode\\Harvest\\Api\\Normalizer\\UserAssignmentsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments' => 'JoliCode\\Harvest\\Api\\Normalizer\\TaskAssignmentsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Projects' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Roles' => 'JoliCode\\Harvest\\Api\\Normalizer\\RolesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Teammates' => 'JoliCode\\Harvest\\Api\\Normalizer\\TeammatesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\BillableRates' => 'JoliCode\\Harvest\\Api\\Normalizer\\BillableRatesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\CostRates' => 'JoliCode\\Harvest\\Api\\Normalizer\\CostRatesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectAssignmentsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Users' => 'JoliCode\\Harvest\\Api\\Normalizer\\UsersNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseReportsResultsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults' => 'JoliCode\\Harvest\\Api\\Normalizer\\UninvoicedReportResultsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeReportsResultsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectBudgetReportResultsNormalizer', 'JoliCode\\Harvest\\Api\\Model\\Error' => 'JoliCode\\Harvest\\Api\\Normalizer\\ErrorNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageSubjectAndBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceMessageSubjectAndBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks' => 'JoliCode\\Harvest\\Api\\Normalizer\\PaginationLinksNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TeammatesPatchResponse' => 'JoliCode\\Harvest\\Api\\Normalizer\\TeammatesPatchResponseNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ClientsPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ClientsClientIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\CompanyPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ContactsPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ContactsContactIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateItemCategoriesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesPostBodyLineItemsItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesEstimateIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesEstimateIdPatchBodyLineItemsItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesEstimateIdMessagesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseCategoriesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpensesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ExpensesExpenseIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceItemCategoriesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesPostBodyLineItemsImportNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesPostBodyLineItemsImportTimeNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesPostBodyLineItemsImportExpensesNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesPostBodyLineItemsItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesInvoiceIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesInvoiceIdMessagesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer', 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\InvoicesInvoiceIdPaymentsPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsProjectIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsProjectIdTaskAssignmentsPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsProjectIdUserAssignmentsPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\RolesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\RolesRoleIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\TasksPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\TasksTaskIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntriesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntriesPostBodyExternalReferenceNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntriesTimeEntryIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference' => 'JoliCode\\Harvest\\Api\\Normalizer\\TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\UsersPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\UsersUserIdPatchBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\UsersUserIdBillableRatesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\UsersUserIdCostRatesPostBodyNormalizer', 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdTeammatesPatchBody' => 'JoliCode\\Harvest\\Api\\Normalizer\\UsersUserIdTeammatesPatchBodyNormalizer', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\JoliCode\\Harvest\\Api\\Runtime\\Normalizer\\ReferenceNormalizer']; protected $normalizersCache = []; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return \array_key_exists($type, $this->normalizers); } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && \array_key_exists(\get_class($data), $this->normalizers); } diff --git a/generated/Normalizer/PaginationLinksNormalizer.php b/generated/Normalizer/PaginationLinksNormalizer.php index 31fb938..f1f5a72 100644 --- a/generated/Normalizer/PaginationLinksNormalizer.php +++ b/generated/Normalizer/PaginationLinksNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class PaginationLinksNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks' === \get_class($data); } @@ -57,20 +59,29 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('first', $data)) { $object->setFirst($data['first']); + unset($data['first']); } if (\array_key_exists('last', $data)) { $object->setLast($data['last']); + unset($data['last']); } if (\array_key_exists('previous', $data) && null !== $data['previous']) { $object->setPrevious($data['previous']); + unset($data['previous']); } elseif (\array_key_exists('previous', $data) && null === $data['previous']) { $object->setPrevious(null); } if (\array_key_exists('next', $data) && null !== $data['next']) { $object->setNext($data['next']); + unset($data['next']); } elseif (\array_key_exists('next', $data) && null === $data['next']) { $object->setNext(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -86,12 +97,17 @@ public function normalize($object, $format = null, array $context = []) $data = []; $data['first'] = $object->getFirst(); $data['last'] = $object->getLast(); - if (null !== $object->getPrevious()) { + if ($object->isInitialized('previous') && null !== $object->getPrevious()) { $data['previous'] = $object->getPrevious(); } - if (null !== $object->getNext()) { + if ($object->isInitialized('next') && null !== $object->getNext()) { $data['next'] = $object->getNext(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectAssignmentClientNormalizer.php b/generated/Normalizer/ProjectAssignmentClientNormalizer.php index b4bc422..0393857 100644 --- a/generated/Normalizer/ProjectAssignmentClientNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectAssignmentClientNormalizer implements DenormalizerInterface, Normal use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectAssignmentNormalizer.php b/generated/Normalizer/ProjectAssignmentNormalizer.php index 0dcb3c5..8c8b95c 100644 --- a/generated/Normalizer/ProjectAssignmentNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectAssignmentNormalizer implements DenormalizerInterface, NormalizerIn use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment' === \get_class($data); } @@ -52,56 +54,72 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectAssignment(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); + unset($data['is_project_manager']); } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); + unset($data['use_default_rates']); } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject', 'json', $context)); + unset($data['project']); } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } @@ -111,9 +129,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json', $context); } $object->setTaskAssignments($values); + unset($data['task_assignments']); } elseif (\array_key_exists('task_assignments', $data) && null === $data['task_assignments']) { $object->setTaskAssignments(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -127,43 +151,48 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getIsProjectManager()) { + if ($object->isInitialized('isProjectManager') && null !== $object->getIsProjectManager()) { $data['is_project_manager'] = $object->getIsProjectManager(); } - if (null !== $object->getUseDefaultRates()) { + if ($object->isInitialized('useDefaultRates') && null !== $object->getUseDefaultRates()) { $data['use_default_rates'] = $object->getUseDefaultRates(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getProject()) { + if ($object->isInitialized('project') && null !== $object->getProject()) { $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getTaskAssignments()) { + if ($object->isInitialized('taskAssignments') && null !== $object->getTaskAssignments()) { $values = []; foreach ($object->getTaskAssignments() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['task_assignments'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ProjectAssignmentProjectNormalizer.php b/generated/Normalizer/ProjectAssignmentProjectNormalizer.php index 21dc36b..478b40b 100644 --- a/generated/Normalizer/ProjectAssignmentProjectNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectAssignmentProjectNormalizer implements DenormalizerInterface, Norma use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectAssignmentsNormalizer.php b/generated/Normalizer/ProjectAssignmentsNormalizer.php index 7bd4611..52c10db 100644 --- a/generated/Normalizer/ProjectAssignmentsNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectAssignmentsNormalizer implements DenormalizerInterface, NormalizerI use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment', 'json', $context); } $object->setProjectAssignments($values); + unset($data['project_assignments']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ProjectBudgetReportResultNormalizer.php b/generated/Normalizer/ProjectBudgetReportResultNormalizer.php index 0037b35..6a562e4 100644 --- a/generated/Normalizer/ProjectBudgetReportResultNormalizer.php +++ b/generated/Normalizer/ProjectBudgetReportResultNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectBudgetReportResultNormalizer implements DenormalizerInterface, Norm use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult' === \get_class($data); } @@ -52,59 +54,83 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectBudgetReportResult(); + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } + if (\array_key_exists('budget_spent', $data) && \is_int($data['budget_spent'])) { + $data['budget_spent'] = (float) $data['budget_spent']; + } + if (\array_key_exists('budget_remaining', $data) && \is_int($data['budget_remaining'])) { + $data['budget_remaining'] = (float) $data['budget_remaining']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); + unset($data['client_name']); } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); + unset($data['project_name']); } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); + unset($data['budget_is_monthly']); } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { $object->setBudgetIsMonthly(null); } if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); + unset($data['budget_by']); } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('budget_spent', $data) && null !== $data['budget_spent']) { $object->setBudgetSpent($data['budget_spent']); + unset($data['budget_spent']); } elseif (\array_key_exists('budget_spent', $data) && null === $data['budget_spent']) { $object->setBudgetSpent(null); } if (\array_key_exists('budget_remaining', $data) && null !== $data['budget_remaining']) { $object->setBudgetRemaining($data['budget_remaining']); + unset($data['budget_remaining']); } elseif (\array_key_exists('budget_remaining', $data) && null === $data['budget_remaining']) { $object->setBudgetRemaining(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -118,36 +144,41 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getClientName()) { + if ($object->isInitialized('clientName') && null !== $object->getClientName()) { $data['client_name'] = $object->getClientName(); } - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getProjectName()) { + if ($object->isInitialized('projectName') && null !== $object->getProjectName()) { $data['project_name'] = $object->getProjectName(); } - if (null !== $object->getBudgetIsMonthly()) { + if ($object->isInitialized('budgetIsMonthly') && null !== $object->getBudgetIsMonthly()) { $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); } - if (null !== $object->getBudgetBy()) { + if ($object->isInitialized('budgetBy') && null !== $object->getBudgetBy()) { $data['budget_by'] = $object->getBudgetBy(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } - if (null !== $object->getBudgetSpent()) { + if ($object->isInitialized('budgetSpent') && null !== $object->getBudgetSpent()) { $data['budget_spent'] = $object->getBudgetSpent(); } - if (null !== $object->getBudgetRemaining()) { + if ($object->isInitialized('budgetRemaining') && null !== $object->getBudgetRemaining()) { $data['budget_remaining'] = $object->getBudgetRemaining(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php b/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php index 7ade66b..35fbef2 100644 --- a/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php +++ b/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectBudgetReportResultsNormalizer implements DenormalizerInterface, Nor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult', 'json', $context); } $object->setResults($values); + unset($data['results']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ProjectClientNormalizer.php b/generated/Normalizer/ProjectClientNormalizer.php index 3ecb7ed..50f8898 100644 --- a/generated/Normalizer/ProjectClientNormalizer.php +++ b/generated/Normalizer/ProjectClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectClientNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectClient' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectNormalizer.php b/generated/Normalizer/ProjectNormalizer.php index 6703a61..aed0f1a 100644 --- a/generated/Normalizer/ProjectNormalizer.php +++ b/generated/Normalizer/ProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectNormalizer implements DenormalizerInterface, NormalizerInterface, D use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Project' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Project' === \get_class($data); } @@ -52,129 +54,173 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\Project(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } + if (\array_key_exists('over_budget_notification_percentage', $data) && \is_int($data['over_budget_notification_percentage'])) { + $data['over_budget_notification_percentage'] = (float) $data['over_budget_notification_percentage']; + } + if (\array_key_exists('cost_budget', $data) && \is_int($data['cost_budget'])) { + $data['cost_budget'] = (float) $data['cost_budget']; + } + if (\array_key_exists('fee', $data) && \is_int($data['fee'])) { + $data['fee'] = (float) $data['fee']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ProjectClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_billable', $data) && null !== $data['is_billable']) { $object->setIsBillable($data['is_billable']); + unset($data['is_billable']); } elseif (\array_key_exists('is_billable', $data) && null === $data['is_billable']) { $object->setIsBillable(null); } if (\array_key_exists('is_fixed_fee', $data) && null !== $data['is_fixed_fee']) { $object->setIsFixedFee($data['is_fixed_fee']); + unset($data['is_fixed_fee']); } elseif (\array_key_exists('is_fixed_fee', $data) && null === $data['is_fixed_fee']) { $object->setIsFixedFee(null); } if (\array_key_exists('bill_by', $data) && null !== $data['bill_by']) { $object->setBillBy($data['bill_by']); + unset($data['bill_by']); } elseif (\array_key_exists('bill_by', $data) && null === $data['bill_by']) { $object->setBillBy(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); + unset($data['budget_by']); } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); + unset($data['budget_is_monthly']); } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { $object->setBudgetIsMonthly(null); } if (\array_key_exists('notify_when_over_budget', $data) && null !== $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget($data['notify_when_over_budget']); + unset($data['notify_when_over_budget']); } elseif (\array_key_exists('notify_when_over_budget', $data) && null === $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget(null); } if (\array_key_exists('over_budget_notification_percentage', $data) && null !== $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage($data['over_budget_notification_percentage']); + unset($data['over_budget_notification_percentage']); } elseif (\array_key_exists('over_budget_notification_percentage', $data) && null === $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage(null); } if (\array_key_exists('over_budget_notification_date', $data) && null !== $data['over_budget_notification_date']) { $object->setOverBudgetNotificationDate(\DateTime::createFromFormat('Y-m-d', $data['over_budget_notification_date'])->setTime(0, 0, 0)); + unset($data['over_budget_notification_date']); } elseif (\array_key_exists('over_budget_notification_date', $data) && null === $data['over_budget_notification_date']) { $object->setOverBudgetNotificationDate(null); } if (\array_key_exists('show_budget_to_all', $data) && null !== $data['show_budget_to_all']) { $object->setShowBudgetToAll($data['show_budget_to_all']); + unset($data['show_budget_to_all']); } elseif (\array_key_exists('show_budget_to_all', $data) && null === $data['show_budget_to_all']) { $object->setShowBudgetToAll(null); } if (\array_key_exists('cost_budget', $data) && null !== $data['cost_budget']) { $object->setCostBudget($data['cost_budget']); + unset($data['cost_budget']); } elseif (\array_key_exists('cost_budget', $data) && null === $data['cost_budget']) { $object->setCostBudget(null); } if (\array_key_exists('cost_budget_include_expenses', $data) && null !== $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses($data['cost_budget_include_expenses']); + unset($data['cost_budget_include_expenses']); } elseif (\array_key_exists('cost_budget_include_expenses', $data) && null === $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses(null); } if (\array_key_exists('fee', $data) && null !== $data['fee']) { $object->setFee($data['fee']); + unset($data['fee']); } elseif (\array_key_exists('fee', $data) && null === $data['fee']) { $object->setFee(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('starts_on', $data) && null !== $data['starts_on']) { $object->setStartsOn(\DateTime::createFromFormat('Y-m-d', $data['starts_on'])->setTime(0, 0, 0)); + unset($data['starts_on']); } elseif (\array_key_exists('starts_on', $data) && null === $data['starts_on']) { $object->setStartsOn(null); } if (\array_key_exists('ends_on', $data) && null !== $data['ends_on']) { $object->setEndsOn(\DateTime::createFromFormat('Y-m-d', $data['ends_on'])->setTime(0, 0, 0)); + unset($data['ends_on']); } elseif (\array_key_exists('ends_on', $data) && null === $data['ends_on']) { $object->setEndsOn(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -188,78 +234,83 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getIsBillable()) { + if ($object->isInitialized('isBillable') && null !== $object->getIsBillable()) { $data['is_billable'] = $object->getIsBillable(); } - if (null !== $object->getIsFixedFee()) { + if ($object->isInitialized('isFixedFee') && null !== $object->getIsFixedFee()) { $data['is_fixed_fee'] = $object->getIsFixedFee(); } - if (null !== $object->getBillBy()) { + if ($object->isInitialized('billBy') && null !== $object->getBillBy()) { $data['bill_by'] = $object->getBillBy(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } - if (null !== $object->getBudgetBy()) { + if ($object->isInitialized('budgetBy') && null !== $object->getBudgetBy()) { $data['budget_by'] = $object->getBudgetBy(); } - if (null !== $object->getBudgetIsMonthly()) { + if ($object->isInitialized('budgetIsMonthly') && null !== $object->getBudgetIsMonthly()) { $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); } - if (null !== $object->getNotifyWhenOverBudget()) { + if ($object->isInitialized('notifyWhenOverBudget') && null !== $object->getNotifyWhenOverBudget()) { $data['notify_when_over_budget'] = $object->getNotifyWhenOverBudget(); } - if (null !== $object->getOverBudgetNotificationPercentage()) { + if ($object->isInitialized('overBudgetNotificationPercentage') && null !== $object->getOverBudgetNotificationPercentage()) { $data['over_budget_notification_percentage'] = $object->getOverBudgetNotificationPercentage(); } - if (null !== $object->getOverBudgetNotificationDate()) { + if ($object->isInitialized('overBudgetNotificationDate') && null !== $object->getOverBudgetNotificationDate()) { $data['over_budget_notification_date'] = $object->getOverBudgetNotificationDate()->format('Y-m-d'); } - if (null !== $object->getShowBudgetToAll()) { + if ($object->isInitialized('showBudgetToAll') && null !== $object->getShowBudgetToAll()) { $data['show_budget_to_all'] = $object->getShowBudgetToAll(); } - if (null !== $object->getCostBudget()) { + if ($object->isInitialized('costBudget') && null !== $object->getCostBudget()) { $data['cost_budget'] = $object->getCostBudget(); } - if (null !== $object->getCostBudgetIncludeExpenses()) { + if ($object->isInitialized('costBudgetIncludeExpenses') && null !== $object->getCostBudgetIncludeExpenses()) { $data['cost_budget_include_expenses'] = $object->getCostBudgetIncludeExpenses(); } - if (null !== $object->getFee()) { + if ($object->isInitialized('fee') && null !== $object->getFee()) { $data['fee'] = $object->getFee(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getStartsOn()) { + if ($object->isInitialized('startsOn') && null !== $object->getStartsOn()) { $data['starts_on'] = $object->getStartsOn()->format('Y-m-d'); } - if (null !== $object->getEndsOn()) { + if ($object->isInitialized('endsOn') && null !== $object->getEndsOn()) { $data['ends_on'] = $object->getEndsOn()->format('Y-m-d'); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsNormalizer.php b/generated/Normalizer/ProjectsNormalizer.php index 0b45d6b..dc2dff9 100644 --- a/generated/Normalizer/ProjectsNormalizer.php +++ b/generated/Normalizer/ProjectsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Projects' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Projects' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json', $context); } $object->setProjects($values); + unset($data['projects']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsPostBodyNormalizer.php b/generated/Normalizer/ProjectsPostBodyNormalizer.php index 5ad11a7..7b03aca 100644 --- a/generated/Normalizer/ProjectsPostBodyNormalizer.php +++ b/generated/Normalizer/ProjectsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsPostBodyNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody' === \get_class($data); } @@ -52,109 +54,149 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectsPostBody(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } + if (\array_key_exists('over_budget_notification_percentage', $data) && \is_int($data['over_budget_notification_percentage'])) { + $data['over_budget_notification_percentage'] = (float) $data['over_budget_notification_percentage']; + } + if (\array_key_exists('cost_budget', $data) && \is_int($data['cost_budget'])) { + $data['cost_budget'] = (float) $data['cost_budget']; + } + if (\array_key_exists('fee', $data) && \is_int($data['fee'])) { + $data['fee'] = (float) $data['fee']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_billable', $data) && null !== $data['is_billable']) { $object->setIsBillable($data['is_billable']); + unset($data['is_billable']); } elseif (\array_key_exists('is_billable', $data) && null === $data['is_billable']) { $object->setIsBillable(null); } if (\array_key_exists('is_fixed_fee', $data) && null !== $data['is_fixed_fee']) { $object->setIsFixedFee($data['is_fixed_fee']); + unset($data['is_fixed_fee']); } elseif (\array_key_exists('is_fixed_fee', $data) && null === $data['is_fixed_fee']) { $object->setIsFixedFee(null); } if (\array_key_exists('bill_by', $data) && null !== $data['bill_by']) { $object->setBillBy($data['bill_by']); + unset($data['bill_by']); } elseif (\array_key_exists('bill_by', $data) && null === $data['bill_by']) { $object->setBillBy(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); + unset($data['budget_by']); } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); + unset($data['budget_is_monthly']); } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { $object->setBudgetIsMonthly(null); } if (\array_key_exists('notify_when_over_budget', $data) && null !== $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget($data['notify_when_over_budget']); + unset($data['notify_when_over_budget']); } elseif (\array_key_exists('notify_when_over_budget', $data) && null === $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget(null); } if (\array_key_exists('over_budget_notification_percentage', $data) && null !== $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage($data['over_budget_notification_percentage']); + unset($data['over_budget_notification_percentage']); } elseif (\array_key_exists('over_budget_notification_percentage', $data) && null === $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage(null); } if (\array_key_exists('show_budget_to_all', $data) && null !== $data['show_budget_to_all']) { $object->setShowBudgetToAll($data['show_budget_to_all']); + unset($data['show_budget_to_all']); } elseif (\array_key_exists('show_budget_to_all', $data) && null === $data['show_budget_to_all']) { $object->setShowBudgetToAll(null); } if (\array_key_exists('cost_budget', $data) && null !== $data['cost_budget']) { $object->setCostBudget($data['cost_budget']); + unset($data['cost_budget']); } elseif (\array_key_exists('cost_budget', $data) && null === $data['cost_budget']) { $object->setCostBudget(null); } if (\array_key_exists('cost_budget_include_expenses', $data) && null !== $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses($data['cost_budget_include_expenses']); + unset($data['cost_budget_include_expenses']); } elseif (\array_key_exists('cost_budget_include_expenses', $data) && null === $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses(null); } if (\array_key_exists('fee', $data) && null !== $data['fee']) { $object->setFee($data['fee']); + unset($data['fee']); } elseif (\array_key_exists('fee', $data) && null === $data['fee']) { $object->setFee(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('starts_on', $data) && null !== $data['starts_on']) { $object->setStartsOn(\DateTime::createFromFormat('Y-m-d', $data['starts_on'])->setTime(0, 0, 0)); + unset($data['starts_on']); } elseif (\array_key_exists('starts_on', $data) && null === $data['starts_on']) { $object->setStartsOn(null); } if (\array_key_exists('ends_on', $data) && null !== $data['ends_on']) { $object->setEndsOn(\DateTime::createFromFormat('Y-m-d', $data['ends_on'])->setTime(0, 0, 0)); + unset($data['ends_on']); } elseif (\array_key_exists('ends_on', $data) && null === $data['ends_on']) { $object->setEndsOn(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -170,54 +212,59 @@ public function normalize($object, $format = null, array $context = []) $data = []; $data['client_id'] = $object->getClientId(); $data['name'] = $object->getName(); - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } $data['is_billable'] = $object->getIsBillable(); - if (null !== $object->getIsFixedFee()) { + if ($object->isInitialized('isFixedFee') && null !== $object->getIsFixedFee()) { $data['is_fixed_fee'] = $object->getIsFixedFee(); } $data['bill_by'] = $object->getBillBy(); - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } $data['budget_by'] = $object->getBudgetBy(); - if (null !== $object->getBudgetIsMonthly()) { + if ($object->isInitialized('budgetIsMonthly') && null !== $object->getBudgetIsMonthly()) { $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); } - if (null !== $object->getNotifyWhenOverBudget()) { + if ($object->isInitialized('notifyWhenOverBudget') && null !== $object->getNotifyWhenOverBudget()) { $data['notify_when_over_budget'] = $object->getNotifyWhenOverBudget(); } - if (null !== $object->getOverBudgetNotificationPercentage()) { + if ($object->isInitialized('overBudgetNotificationPercentage') && null !== $object->getOverBudgetNotificationPercentage()) { $data['over_budget_notification_percentage'] = $object->getOverBudgetNotificationPercentage(); } - if (null !== $object->getShowBudgetToAll()) { + if ($object->isInitialized('showBudgetToAll') && null !== $object->getShowBudgetToAll()) { $data['show_budget_to_all'] = $object->getShowBudgetToAll(); } - if (null !== $object->getCostBudget()) { + if ($object->isInitialized('costBudget') && null !== $object->getCostBudget()) { $data['cost_budget'] = $object->getCostBudget(); } - if (null !== $object->getCostBudgetIncludeExpenses()) { + if ($object->isInitialized('costBudgetIncludeExpenses') && null !== $object->getCostBudgetIncludeExpenses()) { $data['cost_budget_include_expenses'] = $object->getCostBudgetIncludeExpenses(); } - if (null !== $object->getFee()) { + if ($object->isInitialized('fee') && null !== $object->getFee()) { $data['fee'] = $object->getFee(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getStartsOn()) { + if ($object->isInitialized('startsOn') && null !== $object->getStartsOn()) { $data['starts_on'] = $object->getStartsOn()->format('Y-m-d'); } - if (null !== $object->getEndsOn()) { + if ($object->isInitialized('endsOn') && null !== $object->getEndsOn()) { $data['ends_on'] = $object->getEndsOn()->format('Y-m-d'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php index 0f06ca5..b10a12a 100644 --- a/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsProjectIdPatchBodyNormalizer implements DenormalizerInterface, Nor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody' === \get_class($data); } @@ -52,109 +54,149 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } + if (\array_key_exists('over_budget_notification_percentage', $data) && \is_int($data['over_budget_notification_percentage'])) { + $data['over_budget_notification_percentage'] = (float) $data['over_budget_notification_percentage']; + } + if (\array_key_exists('cost_budget', $data) && \is_int($data['cost_budget'])) { + $data['cost_budget'] = (float) $data['cost_budget']; + } + if (\array_key_exists('fee', $data) && \is_int($data['fee'])) { + $data['fee'] = (float) $data['fee']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_billable', $data) && null !== $data['is_billable']) { $object->setIsBillable($data['is_billable']); + unset($data['is_billable']); } elseif (\array_key_exists('is_billable', $data) && null === $data['is_billable']) { $object->setIsBillable(null); } if (\array_key_exists('is_fixed_fee', $data) && null !== $data['is_fixed_fee']) { $object->setIsFixedFee($data['is_fixed_fee']); + unset($data['is_fixed_fee']); } elseif (\array_key_exists('is_fixed_fee', $data) && null === $data['is_fixed_fee']) { $object->setIsFixedFee(null); } if (\array_key_exists('bill_by', $data) && null !== $data['bill_by']) { $object->setBillBy($data['bill_by']); + unset($data['bill_by']); } elseif (\array_key_exists('bill_by', $data) && null === $data['bill_by']) { $object->setBillBy(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); + unset($data['budget_by']); } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); + unset($data['budget_is_monthly']); } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { $object->setBudgetIsMonthly(null); } if (\array_key_exists('notify_when_over_budget', $data) && null !== $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget($data['notify_when_over_budget']); + unset($data['notify_when_over_budget']); } elseif (\array_key_exists('notify_when_over_budget', $data) && null === $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget(null); } if (\array_key_exists('over_budget_notification_percentage', $data) && null !== $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage($data['over_budget_notification_percentage']); + unset($data['over_budget_notification_percentage']); } elseif (\array_key_exists('over_budget_notification_percentage', $data) && null === $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage(null); } if (\array_key_exists('show_budget_to_all', $data) && null !== $data['show_budget_to_all']) { $object->setShowBudgetToAll($data['show_budget_to_all']); + unset($data['show_budget_to_all']); } elseif (\array_key_exists('show_budget_to_all', $data) && null === $data['show_budget_to_all']) { $object->setShowBudgetToAll(null); } if (\array_key_exists('cost_budget', $data) && null !== $data['cost_budget']) { $object->setCostBudget($data['cost_budget']); + unset($data['cost_budget']); } elseif (\array_key_exists('cost_budget', $data) && null === $data['cost_budget']) { $object->setCostBudget(null); } if (\array_key_exists('cost_budget_include_expenses', $data) && null !== $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses($data['cost_budget_include_expenses']); + unset($data['cost_budget_include_expenses']); } elseif (\array_key_exists('cost_budget_include_expenses', $data) && null === $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses(null); } if (\array_key_exists('fee', $data) && null !== $data['fee']) { $object->setFee($data['fee']); + unset($data['fee']); } elseif (\array_key_exists('fee', $data) && null === $data['fee']) { $object->setFee(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('starts_on', $data) && null !== $data['starts_on']) { $object->setStartsOn(\DateTime::createFromFormat('Y-m-d', $data['starts_on'])->setTime(0, 0, 0)); + unset($data['starts_on']); } elseif (\array_key_exists('starts_on', $data) && null === $data['starts_on']) { $object->setStartsOn(null); } if (\array_key_exists('ends_on', $data) && null !== $data['ends_on']) { $object->setEndsOn(\DateTime::createFromFormat('Y-m-d', $data['ends_on'])->setTime(0, 0, 0)); + unset($data['ends_on']); } elseif (\array_key_exists('ends_on', $data) && null === $data['ends_on']) { $object->setEndsOn(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -168,66 +210,71 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getIsBillable()) { + if ($object->isInitialized('isBillable') && null !== $object->getIsBillable()) { $data['is_billable'] = $object->getIsBillable(); } - if (null !== $object->getIsFixedFee()) { + if ($object->isInitialized('isFixedFee') && null !== $object->getIsFixedFee()) { $data['is_fixed_fee'] = $object->getIsFixedFee(); } - if (null !== $object->getBillBy()) { + if ($object->isInitialized('billBy') && null !== $object->getBillBy()) { $data['bill_by'] = $object->getBillBy(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } - if (null !== $object->getBudgetBy()) { + if ($object->isInitialized('budgetBy') && null !== $object->getBudgetBy()) { $data['budget_by'] = $object->getBudgetBy(); } - if (null !== $object->getBudgetIsMonthly()) { + if ($object->isInitialized('budgetIsMonthly') && null !== $object->getBudgetIsMonthly()) { $data['budget_is_monthly'] = $object->getBudgetIsMonthly(); } - if (null !== $object->getNotifyWhenOverBudget()) { + if ($object->isInitialized('notifyWhenOverBudget') && null !== $object->getNotifyWhenOverBudget()) { $data['notify_when_over_budget'] = $object->getNotifyWhenOverBudget(); } - if (null !== $object->getOverBudgetNotificationPercentage()) { + if ($object->isInitialized('overBudgetNotificationPercentage') && null !== $object->getOverBudgetNotificationPercentage()) { $data['over_budget_notification_percentage'] = $object->getOverBudgetNotificationPercentage(); } - if (null !== $object->getShowBudgetToAll()) { + if ($object->isInitialized('showBudgetToAll') && null !== $object->getShowBudgetToAll()) { $data['show_budget_to_all'] = $object->getShowBudgetToAll(); } - if (null !== $object->getCostBudget()) { + if ($object->isInitialized('costBudget') && null !== $object->getCostBudget()) { $data['cost_budget'] = $object->getCostBudget(); } - if (null !== $object->getCostBudgetIncludeExpenses()) { + if ($object->isInitialized('costBudgetIncludeExpenses') && null !== $object->getCostBudgetIncludeExpenses()) { $data['cost_budget_include_expenses'] = $object->getCostBudgetIncludeExpenses(); } - if (null !== $object->getFee()) { + if ($object->isInitialized('fee') && null !== $object->getFee()) { $data['fee'] = $object->getFee(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getStartsOn()) { + if ($object->isInitialized('startsOn') && null !== $object->getStartsOn()) { $data['starts_on'] = $object->getStartsOn()->format('Y-m-d'); } - if (null !== $object->getEndsOn()) { + if ($object->isInitialized('endsOn') && null !== $object->getEndsOn()) { $data['ends_on'] = $object->getEndsOn()->format('Y-m-d'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php index d86ed85..6342519 100644 --- a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsProjectIdTaskAssignmentsPostBodyNormalizer implements Denormalizer use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody' === \get_class($data); } @@ -52,34 +54,50 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); + unset($data['task_id']); } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -94,18 +112,23 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['task_id'] = $object->getTaskId(); - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php index 40444cd..82dfb0d 100644 --- a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer implem use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody' === \get_class($data); } @@ -52,29 +54,44 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +105,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php index 6c7d05c..bb1a686 100644 --- a/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsProjectIdUserAssignmentsPostBodyNormalizer implements Denormalizer use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody' === \get_class($data); } @@ -52,39 +54,56 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); + unset($data['user_id']); } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); + unset($data['is_project_manager']); } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); + unset($data['use_default_rates']); } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -99,21 +118,26 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['user_id'] = $object->getUserId(); - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getIsProjectManager()) { + if ($object->isInitialized('isProjectManager') && null !== $object->getIsProjectManager()) { $data['is_project_manager'] = $object->getIsProjectManager(); } - if (null !== $object->getUseDefaultRates()) { + if ($object->isInitialized('useDefaultRates') && null !== $object->getUseDefaultRates()) { $data['use_default_rates'] = $object->getUseDefaultRates(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php index b1b6b59..5d2e969 100644 --- a/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer implem use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody' === \get_class($data); } @@ -52,34 +54,50 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); + unset($data['is_project_manager']); } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); + unset($data['use_default_rates']); } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -93,21 +111,26 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getIsProjectManager()) { + if ($object->isInitialized('isProjectManager') && null !== $object->getIsProjectManager()) { $data['is_project_manager'] = $object->getIsProjectManager(); } - if (null !== $object->getUseDefaultRates()) { + if ($object->isInitialized('useDefaultRates') && null !== $object->getUseDefaultRates()) { $data['use_default_rates'] = $object->getUseDefaultRates(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/RoleNormalizer.php b/generated/Normalizer/RoleNormalizer.php index 5ea2508..8b4dcd4 100644 --- a/generated/Normalizer/RoleNormalizer.php +++ b/generated/Normalizer/RoleNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class RoleNormalizer implements DenormalizerInterface, NormalizerInterface, Deno use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Role' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Role' === \get_class($data); } @@ -57,11 +59,13 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } @@ -71,19 +75,27 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setUserIds($values); + unset($data['user_ids']); } elseif (\array_key_exists('user_ids', $data) && null === $data['user_ids']) { $object->setUserIds(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -97,25 +109,30 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getUserIds()) { + if ($object->isInitialized('userIds') && null !== $object->getUserIds()) { $values = []; foreach ($object->getUserIds() as $value) { $values[] = $value; } $data['user_ids'] = $values; } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/RolesNormalizer.php b/generated/Normalizer/RolesNormalizer.php index 9fba7b1..6543e44 100644 --- a/generated/Normalizer/RolesNormalizer.php +++ b/generated/Normalizer/RolesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class RolesNormalizer implements DenormalizerInterface, NormalizerInterface, Den use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Roles' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Roles' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json', $context); } $object->setRoles($values); + unset($data['roles']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/RolesPostBodyNormalizer.php b/generated/Normalizer/RolesPostBodyNormalizer.php index d9be5de..5889bd4 100644 --- a/generated/Normalizer/RolesPostBodyNormalizer.php +++ b/generated/Normalizer/RolesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class RolesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody' === \get_class($data); } @@ -57,6 +59,7 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } @@ -66,9 +69,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setUserIds($values); + unset($data['user_ids']); } elseif (\array_key_exists('user_ids', $data) && null === $data['user_ids']) { $object->setUserIds(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -83,13 +92,18 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['name'] = $object->getName(); - if (null !== $object->getUserIds()) { + if ($object->isInitialized('userIds') && null !== $object->getUserIds()) { $values = []; foreach ($object->getUserIds() as $value) { $values[] = $value; } $data['user_ids'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php b/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php index bd9ed94..1a61cc9 100644 --- a/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php +++ b/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class RolesRoleIdPatchBodyNormalizer implements DenormalizerInterface, Normalize use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody' === \get_class($data); } @@ -57,6 +59,7 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } @@ -66,9 +69,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setUserIds($values); + unset($data['user_ids']); } elseif (\array_key_exists('user_ids', $data) && null === $data['user_ids']) { $object->setUserIds(null); } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } + } return $object; } @@ -82,16 +91,21 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getUserIds()) { + if ($object->isInitialized('userIds') && null !== $object->getUserIds()) { $values = []; foreach ($object->getUserIds() as $value) { $values[] = $value; } $data['user_ids'] = $values; } + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/TaskAssignmentNormalizer.php b/generated/Normalizer/TaskAssignmentNormalizer.php index 7973035..80d1f9b 100644 --- a/generated/Normalizer/TaskAssignmentNormalizer.php +++ b/generated/Normalizer/TaskAssignmentNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TaskAssignmentNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment' === \get_class($data); } @@ -52,54 +54,74 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TaskAssignment(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject', 'json', $context)); + unset($data['project']); } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } if (\array_key_exists('task', $data) && null !== $data['task']) { $object->setTask($this->denormalizer->denormalize($data['task'], 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask', 'json', $context)); + unset($data['task']); } elseif (\array_key_exists('task', $data) && null === $data['task']) { $object->setTask(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -113,33 +135,38 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getProject()) { + if ($object->isInitialized('project') && null !== $object->getProject()) { $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); } - if (null !== $object->getTask()) { + if ($object->isInitialized('task') && null !== $object->getTask()) { $data['task'] = $this->normalizer->normalize($object->getTask(), 'json', $context); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TaskAssignmentProjectNormalizer.php b/generated/Normalizer/TaskAssignmentProjectNormalizer.php index 13a1cd7..6d5684f 100644 --- a/generated/Normalizer/TaskAssignmentProjectNormalizer.php +++ b/generated/Normalizer/TaskAssignmentProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TaskAssignmentProjectNormalizer implements DenormalizerInterface, Normaliz use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TaskAssignmentTaskNormalizer.php b/generated/Normalizer/TaskAssignmentTaskNormalizer.php index 7631221..2f896ab 100644 --- a/generated/Normalizer/TaskAssignmentTaskNormalizer.php +++ b/generated/Normalizer/TaskAssignmentTaskNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TaskAssignmentTaskNormalizer implements DenormalizerInterface, NormalizerI use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TaskAssignmentsNormalizer.php b/generated/Normalizer/TaskAssignmentsNormalizer.php index 1f858ac..27e41f9 100644 --- a/generated/Normalizer/TaskAssignmentsNormalizer.php +++ b/generated/Normalizer/TaskAssignmentsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TaskAssignmentsNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json', $context); } $object->setTaskAssignments($values); + unset($data['task_assignments']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/TaskNormalizer.php b/generated/Normalizer/TaskNormalizer.php index fc8cbf8..464cbe7 100644 --- a/generated/Normalizer/TaskNormalizer.php +++ b/generated/Normalizer/TaskNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TaskNormalizer implements DenormalizerInterface, NormalizerInterface, Deno use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Task' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Task' === \get_class($data); } @@ -52,49 +54,65 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\Task(); + if (\array_key_exists('default_hourly_rate', $data) && \is_int($data['default_hourly_rate'])) { + $data['default_hourly_rate'] = (float) $data['default_hourly_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('billable_by_default', $data) && null !== $data['billable_by_default']) { $object->setBillableByDefault($data['billable_by_default']); + unset($data['billable_by_default']); } elseif (\array_key_exists('billable_by_default', $data) && null === $data['billable_by_default']) { $object->setBillableByDefault(null); } if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); + unset($data['default_hourly_rate']); } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } if (\array_key_exists('is_default', $data) && null !== $data['is_default']) { $object->setIsDefault($data['is_default']); + unset($data['is_default']); } elseif (\array_key_exists('is_default', $data) && null === $data['is_default']) { $object->setIsDefault(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -108,30 +126,35 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getBillableByDefault()) { + if ($object->isInitialized('billableByDefault') && null !== $object->getBillableByDefault()) { $data['billable_by_default'] = $object->getBillableByDefault(); } - if (null !== $object->getDefaultHourlyRate()) { + if ($object->isInitialized('defaultHourlyRate') && null !== $object->getDefaultHourlyRate()) { $data['default_hourly_rate'] = $object->getDefaultHourlyRate(); } - if (null !== $object->getIsDefault()) { + if ($object->isInitialized('isDefault') && null !== $object->getIsDefault()) { $data['is_default'] = $object->getIsDefault(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TasksNormalizer.php b/generated/Normalizer/TasksNormalizer.php index ba64b7e..d7282d3 100644 --- a/generated/Normalizer/TasksNormalizer.php +++ b/generated/Normalizer/TasksNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TasksNormalizer implements DenormalizerInterface, NormalizerInterface, Den use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Tasks' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Tasks' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json', $context); } $object->setTasks($values); + unset($data['tasks']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/TasksPostBodyNormalizer.php b/generated/Normalizer/TasksPostBodyNormalizer.php index 91b0db3..5dc44bf 100644 --- a/generated/Normalizer/TasksPostBodyNormalizer.php +++ b/generated/Normalizer/TasksPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TasksPostBodyNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody' === \get_class($data); } @@ -52,34 +54,47 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TasksPostBody(); + if (\array_key_exists('default_hourly_rate', $data) && \is_int($data['default_hourly_rate'])) { + $data['default_hourly_rate'] = (float) $data['default_hourly_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('billable_by_default', $data) && null !== $data['billable_by_default']) { $object->setBillableByDefault($data['billable_by_default']); + unset($data['billable_by_default']); } elseif (\array_key_exists('billable_by_default', $data) && null === $data['billable_by_default']) { $object->setBillableByDefault(null); } if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); + unset($data['default_hourly_rate']); } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } if (\array_key_exists('is_default', $data) && null !== $data['is_default']) { $object->setIsDefault($data['is_default']); + unset($data['is_default']); } elseif (\array_key_exists('is_default', $data) && null === $data['is_default']) { $object->setIsDefault(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -94,18 +109,23 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['name'] = $object->getName(); - if (null !== $object->getBillableByDefault()) { + if ($object->isInitialized('billableByDefault') && null !== $object->getBillableByDefault()) { $data['billable_by_default'] = $object->getBillableByDefault(); } - if (null !== $object->getDefaultHourlyRate()) { + if ($object->isInitialized('defaultHourlyRate') && null !== $object->getDefaultHourlyRate()) { $data['default_hourly_rate'] = $object->getDefaultHourlyRate(); } - if (null !== $object->getIsDefault()) { + if ($object->isInitialized('isDefault') && null !== $object->getIsDefault()) { $data['is_default'] = $object->getIsDefault(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php b/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php index aeb08ef..3507c26 100644 --- a/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php +++ b/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TasksTaskIdPatchBodyNormalizer implements DenormalizerInterface, Normalize use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody' === \get_class($data); } @@ -52,34 +54,47 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody(); + if (\array_key_exists('default_hourly_rate', $data) && \is_int($data['default_hourly_rate'])) { + $data['default_hourly_rate'] = (float) $data['default_hourly_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('billable_by_default', $data) && null !== $data['billable_by_default']) { $object->setBillableByDefault($data['billable_by_default']); + unset($data['billable_by_default']); } elseif (\array_key_exists('billable_by_default', $data) && null === $data['billable_by_default']) { $object->setBillableByDefault(null); } if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); + unset($data['default_hourly_rate']); } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } if (\array_key_exists('is_default', $data) && null !== $data['is_default']) { $object->setIsDefault($data['is_default']); + unset($data['is_default']); } elseif (\array_key_exists('is_default', $data) && null === $data['is_default']) { $object->setIsDefault(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -93,21 +108,26 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getBillableByDefault()) { + if ($object->isInitialized('billableByDefault') && null !== $object->getBillableByDefault()) { $data['billable_by_default'] = $object->getBillableByDefault(); } - if (null !== $object->getDefaultHourlyRate()) { + if ($object->isInitialized('defaultHourlyRate') && null !== $object->getDefaultHourlyRate()) { $data['default_hourly_rate'] = $object->getDefaultHourlyRate(); } - if (null !== $object->getIsDefault()) { + if ($object->isInitialized('isDefault') && null !== $object->getIsDefault()) { $data['is_default'] = $object->getIsDefault(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TeammateNormalizer.php b/generated/Normalizer/TeammateNormalizer.php index 3500933..412fea3 100644 --- a/generated/Normalizer/TeammateNormalizer.php +++ b/generated/Normalizer/TeammateNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TeammateNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Teammate' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Teammate' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getFirstName()) { + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { $data['first_name'] = $object->getFirstName(); } - if (null !== $object->getLastName()) { + if ($object->isInitialized('lastName') && null !== $object->getLastName()) { $data['last_name'] = $object->getLastName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TeammatesNormalizer.php b/generated/Normalizer/TeammatesNormalizer.php index 22792c5..ee68efe 100644 --- a/generated/Normalizer/TeammatesNormalizer.php +++ b/generated/Normalizer/TeammatesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TeammatesNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Teammates' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Teammates' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Teammate', 'json', $context); } $object->setTeammates($values); + unset($data['teammates']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/TeammatesPatchResponseNormalizer.php b/generated/Normalizer/TeammatesPatchResponseNormalizer.php index cee1ab1..edd1f97 100644 --- a/generated/Normalizer/TeammatesPatchResponseNormalizer.php +++ b/generated/Normalizer/TeammatesPatchResponseNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TeammatesPatchResponseNormalizer implements DenormalizerInterface, Normali use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TeammatesPatchResponse' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TeammatesPatchResponse' === \get_class($data); } @@ -61,6 +63,12 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Teammate', 'json', $context); } $object->setTeammates($values); + unset($data['teammates']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -80,6 +88,11 @@ public function normalize($object, $format = null, array $context = []) $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['teammates'] = $values; + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntriesNormalizer.php b/generated/Normalizer/TimeEntriesNormalizer.php index bd4709d..c59a640 100644 --- a/generated/Normalizer/TimeEntriesNormalizer.php +++ b/generated/Normalizer/TimeEntriesNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntriesNormalizer implements DenormalizerInterface, NormalizerInterfac use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntries' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntries' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json', $context); } $object->setTimeEntries($values); + unset($data['time_entries']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php b/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php index f9c26d1..66131b5 100644 --- a/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php +++ b/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntriesPostBodyExternalReferenceNormalizer implements DenormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('group_id', $data) && null !== $data['group_id']) { $object->setGroupId($data['group_id']); + unset($data['group_id']); } elseif (\array_key_exists('group_id', $data) && null === $data['group_id']) { $object->setGroupId(null); } if (\array_key_exists('account_id', $data) && null !== $data['account_id']) { $object->setAccountId($data['account_id']); + unset($data['account_id']); } elseif (\array_key_exists('account_id', $data) && null === $data['account_id']) { $object->setAccountId(null); } if (\array_key_exists('permalink', $data) && null !== $data['permalink']) { $object->setPermalink($data['permalink']); + unset($data['permalink']); } elseif (\array_key_exists('permalink', $data) && null === $data['permalink']) { $object->setPermalink(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getGroupId()) { + if ($object->isInitialized('groupId') && null !== $object->getGroupId()) { $data['group_id'] = $object->getGroupId(); } - if (null !== $object->getAccountId()) { + if ($object->isInitialized('accountId') && null !== $object->getAccountId()) { $data['account_id'] = $object->getAccountId(); } - if (null !== $object->getPermalink()) { + if ($object->isInitialized('permalink') && null !== $object->getPermalink()) { $data['permalink'] = $object->getPermalink(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntriesPostBodyNormalizer.php b/generated/Normalizer/TimeEntriesPostBodyNormalizer.php index 94e6d79..b1facc5 100644 --- a/generated/Normalizer/TimeEntriesPostBodyNormalizer.php +++ b/generated/Normalizer/TimeEntriesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntriesPostBodyNormalizer implements DenormalizerInterface, Normalizer use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody' === \get_class($data); } @@ -52,54 +54,71 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TimeEntriesPostBody(); + if (\array_key_exists('hours', $data) && \is_int($data['hours'])) { + $data['hours'] = (float) $data['hours']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); + unset($data['user_id']); } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); + unset($data['task_id']); } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } if (\array_key_exists('spent_date', $data) && null !== $data['spent_date']) { $object->setSpentDate(\DateTime::createFromFormat('Y-m-d', $data['spent_date'])->setTime(0, 0, 0)); + unset($data['spent_date']); } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } if (\array_key_exists('started_time', $data) && null !== $data['started_time']) { $object->setStartedTime($data['started_time']); + unset($data['started_time']); } elseif (\array_key_exists('started_time', $data) && null === $data['started_time']) { $object->setStartedTime(null); } if (\array_key_exists('ended_time', $data) && null !== $data['ended_time']) { $object->setEndedTime($data['ended_time']); + unset($data['ended_time']); } elseif (\array_key_exists('ended_time', $data) && null === $data['ended_time']) { $object->setEndedTime(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('external_reference', $data) && null !== $data['external_reference']) { $object->setExternalReference($this->denormalizer->denormalize($data['external_reference'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference', 'json', $context)); + unset($data['external_reference']); } elseif (\array_key_exists('external_reference', $data) && null === $data['external_reference']) { $object->setExternalReference(null); } if (\array_key_exists('hours', $data) && null !== $data['hours']) { $object->setHours($data['hours']); + unset($data['hours']); } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { $object->setHours(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -113,27 +132,32 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getUserId()) { + if ($object->isInitialized('userId') && null !== $object->getUserId()) { $data['user_id'] = $object->getUserId(); } $data['project_id'] = $object->getProjectId(); $data['task_id'] = $object->getTaskId(); $data['spent_date'] = $object->getSpentDate()->format('Y-m-d'); - if (null !== $object->getStartedTime()) { + if ($object->isInitialized('startedTime') && null !== $object->getStartedTime()) { $data['started_time'] = $object->getStartedTime(); } - if (null !== $object->getEndedTime()) { + if ($object->isInitialized('endedTime') && null !== $object->getEndedTime()) { $data['ended_time'] = $object->getEndedTime(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getExternalReference()) { + if ($object->isInitialized('externalReference') && null !== $object->getExternalReference()) { $data['external_reference'] = $this->normalizer->normalize($object->getExternalReference(), 'json', $context); } - if (null !== $object->getHours()) { + if ($object->isInitialized('hours') && null !== $object->getHours()) { $data['hours'] = $object->getHours(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php index 6533dc2..0ebcef2 100644 --- a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php +++ b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer implements Deno use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference' === \get_class($data); } @@ -57,24 +59,33 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('group_id', $data) && null !== $data['group_id']) { $object->setGroupId($data['group_id']); + unset($data['group_id']); } elseif (\array_key_exists('group_id', $data) && null === $data['group_id']) { $object->setGroupId(null); } if (\array_key_exists('account_id', $data) && null !== $data['account_id']) { $object->setAccountId($data['account_id']); + unset($data['account_id']); } elseif (\array_key_exists('account_id', $data) && null === $data['account_id']) { $object->setAccountId(null); } if (\array_key_exists('permalink', $data) && null !== $data['permalink']) { $object->setPermalink($data['permalink']); + unset($data['permalink']); } elseif (\array_key_exists('permalink', $data) && null === $data['permalink']) { $object->setPermalink(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -88,18 +99,23 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getGroupId()) { + if ($object->isInitialized('groupId') && null !== $object->getGroupId()) { $data['group_id'] = $object->getGroupId(); } - if (null !== $object->getAccountId()) { + if ($object->isInitialized('accountId') && null !== $object->getAccountId()) { $data['account_id'] = $object->getAccountId(); } - if (null !== $object->getPermalink()) { + if ($object->isInitialized('permalink') && null !== $object->getPermalink()) { $data['permalink'] = $object->getPermalink(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php index eadcdad..05db55a 100644 --- a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntriesTimeEntryIdPatchBodyNormalizer implements DenormalizerInterface use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody' === \get_class($data); } @@ -52,49 +54,65 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody(); + if (\array_key_exists('hours', $data) && \is_int($data['hours'])) { + $data['hours'] = (float) $data['hours']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); + unset($data['task_id']); } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } if (\array_key_exists('spent_date', $data) && null !== $data['spent_date']) { $object->setSpentDate(\DateTime::createFromFormat('Y-m-d', $data['spent_date'])->setTime(0, 0, 0)); + unset($data['spent_date']); } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } if (\array_key_exists('started_time', $data) && null !== $data['started_time']) { $object->setStartedTime($data['started_time']); + unset($data['started_time']); } elseif (\array_key_exists('started_time', $data) && null === $data['started_time']) { $object->setStartedTime(null); } if (\array_key_exists('ended_time', $data) && null !== $data['ended_time']) { $object->setEndedTime($data['ended_time']); + unset($data['ended_time']); } elseif (\array_key_exists('ended_time', $data) && null === $data['ended_time']) { $object->setEndedTime(null); } if (\array_key_exists('hours', $data) && null !== $data['hours']) { $object->setHours($data['hours']); + unset($data['hours']); } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { $object->setHours(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('external_reference', $data) && null !== $data['external_reference']) { $object->setExternalReference($this->denormalizer->denormalize($data['external_reference'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference', 'json', $context)); + unset($data['external_reference']); } elseif (\array_key_exists('external_reference', $data) && null === $data['external_reference']) { $object->setExternalReference(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -108,30 +126,35 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getTaskId()) { + if ($object->isInitialized('taskId') && null !== $object->getTaskId()) { $data['task_id'] = $object->getTaskId(); } - if (null !== $object->getSpentDate()) { + if ($object->isInitialized('spentDate') && null !== $object->getSpentDate()) { $data['spent_date'] = $object->getSpentDate()->format('Y-m-d'); } - if (null !== $object->getStartedTime()) { + if ($object->isInitialized('startedTime') && null !== $object->getStartedTime()) { $data['started_time'] = $object->getStartedTime(); } - if (null !== $object->getEndedTime()) { + if ($object->isInitialized('endedTime') && null !== $object->getEndedTime()) { $data['ended_time'] = $object->getEndedTime(); } - if (null !== $object->getHours()) { + if ($object->isInitialized('hours') && null !== $object->getHours()) { $data['hours'] = $object->getHours(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getExternalReference()) { + if ($object->isInitialized('externalReference') && null !== $object->getExternalReference()) { $data['external_reference'] = $this->normalizer->normalize($object->getExternalReference(), 'json', $context); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryClientNormalizer.php b/generated/Normalizer/TimeEntryClientNormalizer.php index 3085bfe..1348b18 100644 --- a/generated/Normalizer/TimeEntryClientNormalizer.php +++ b/generated/Normalizer/TimeEntryClientNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryClientNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php b/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php index acca3c2..a9cf88b 100644 --- a/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php +++ b/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryExternalReferenceNormalizer implements DenormalizerInterface, Nor use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference' === \get_class($data); } @@ -57,34 +59,45 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('group_id', $data) && null !== $data['group_id']) { $object->setGroupId($data['group_id']); + unset($data['group_id']); } elseif (\array_key_exists('group_id', $data) && null === $data['group_id']) { $object->setGroupId(null); } if (\array_key_exists('account_id', $data) && null !== $data['account_id']) { $object->setAccountId($data['account_id']); + unset($data['account_id']); } elseif (\array_key_exists('account_id', $data) && null === $data['account_id']) { $object->setAccountId(null); } if (\array_key_exists('permalink', $data) && null !== $data['permalink']) { $object->setPermalink($data['permalink']); + unset($data['permalink']); } elseif (\array_key_exists('permalink', $data) && null === $data['permalink']) { $object->setPermalink(null); } if (\array_key_exists('service', $data) && null !== $data['service']) { $object->setService($data['service']); + unset($data['service']); } elseif (\array_key_exists('service', $data) && null === $data['service']) { $object->setService(null); } if (\array_key_exists('service_icon_url', $data) && null !== $data['service_icon_url']) { $object->setServiceIconUrl($data['service_icon_url']); + unset($data['service_icon_url']); } elseif (\array_key_exists('service_icon_url', $data) && null === $data['service_icon_url']) { $object->setServiceIconUrl(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -98,24 +111,29 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getGroupId()) { + if ($object->isInitialized('groupId') && null !== $object->getGroupId()) { $data['group_id'] = $object->getGroupId(); } - if (null !== $object->getAccountId()) { + if ($object->isInitialized('accountId') && null !== $object->getAccountId()) { $data['account_id'] = $object->getAccountId(); } - if (null !== $object->getPermalink()) { + if ($object->isInitialized('permalink') && null !== $object->getPermalink()) { $data['permalink'] = $object->getPermalink(); } - if (null !== $object->getService()) { + if ($object->isInitialized('service') && null !== $object->getService()) { $data['service'] = $object->getService(); } - if (null !== $object->getServiceIconUrl()) { + if ($object->isInitialized('serviceIconUrl') && null !== $object->getServiceIconUrl()) { $data['service_icon_url'] = $object->getServiceIconUrl(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryInvoiceNormalizer.php b/generated/Normalizer/TimeEntryInvoiceNormalizer.php index 24a355c..b15e9b8 100644 --- a/generated/Normalizer/TimeEntryInvoiceNormalizer.php +++ b/generated/Normalizer/TimeEntryInvoiceNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryInvoiceNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); + unset($data['number']); } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getNumber()) { + if ($object->isInitialized('number') && null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryNormalizer.php b/generated/Normalizer/TimeEntryNormalizer.php index 27bc42d..39c09fc 100644 --- a/generated/Normalizer/TimeEntryNormalizer.php +++ b/generated/Normalizer/TimeEntryNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryNormalizer implements DenormalizerInterface, NormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntry' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntry' === \get_class($data); } @@ -52,145 +54,193 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TimeEntry(); + if (\array_key_exists('hours', $data) && \is_int($data['hours'])) { + $data['hours'] = (float) $data['hours']; + } + if (\array_key_exists('hours_without_timer', $data) && \is_int($data['hours_without_timer'])) { + $data['hours_without_timer'] = (float) $data['hours_without_timer']; + } + if (\array_key_exists('rounded_hours', $data) && \is_int($data['rounded_hours'])) { + $data['rounded_hours'] = (float) $data['rounded_hours']; + } + if (\array_key_exists('billable_rate', $data) && \is_int($data['billable_rate'])) { + $data['billable_rate'] = (float) $data['billable_rate']; + } + if (\array_key_exists('cost_rate', $data) && \is_int($data['cost_rate'])) { + $data['cost_rate'] = (float) $data['cost_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('spent_date', $data) && null !== $data['spent_date']) { $object->setSpentDate(\DateTime::createFromFormat('Y-m-d', $data['spent_date'])->setTime(0, 0, 0)); + unset($data['spent_date']); } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } if (\array_key_exists('user', $data) && null !== $data['user']) { $object->setUser($this->denormalizer->denormalize($data['user'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser', 'json', $context)); + unset($data['user']); } elseif (\array_key_exists('user', $data) && null === $data['user']) { $object->setUser(null); } if (\array_key_exists('user_assignment', $data)) { $object->setUserAssignment($this->denormalizer->denormalize($data['user_assignment'], 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json', $context)); + unset($data['user_assignment']); } if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient', 'json', $context)); + unset($data['client']); } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject', 'json', $context)); + unset($data['project']); } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } if (\array_key_exists('task', $data) && null !== $data['task']) { $object->setTask($this->denormalizer->denormalize($data['task'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask', 'json', $context)); + unset($data['task']); } elseif (\array_key_exists('task', $data) && null === $data['task']) { $object->setTask(null); } if (\array_key_exists('task_assignment', $data)) { $object->setTaskAssignment($this->denormalizer->denormalize($data['task_assignment'], 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json', $context)); + unset($data['task_assignment']); } if (\array_key_exists('external_reference', $data) && null !== $data['external_reference']) { $object->setExternalReference($this->denormalizer->denormalize($data['external_reference'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference', 'json', $context)); + unset($data['external_reference']); } elseif (\array_key_exists('external_reference', $data) && null === $data['external_reference']) { $object->setExternalReference(null); } if (\array_key_exists('invoice', $data) && null !== $data['invoice']) { $object->setInvoice($this->denormalizer->denormalize($data['invoice'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice', 'json', $context)); + unset($data['invoice']); } elseif (\array_key_exists('invoice', $data) && null === $data['invoice']) { $object->setInvoice(null); } if (\array_key_exists('hours', $data) && null !== $data['hours']) { $object->setHours($data['hours']); + unset($data['hours']); } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { $object->setHours(null); } if (\array_key_exists('hours_without_timer', $data) && null !== $data['hours_without_timer']) { $object->setHoursWithoutTimer($data['hours_without_timer']); + unset($data['hours_without_timer']); } elseif (\array_key_exists('hours_without_timer', $data) && null === $data['hours_without_timer']) { $object->setHoursWithoutTimer(null); } if (\array_key_exists('rounded_hours', $data) && null !== $data['rounded_hours']) { $object->setRoundedHours($data['rounded_hours']); + unset($data['rounded_hours']); } elseif (\array_key_exists('rounded_hours', $data) && null === $data['rounded_hours']) { $object->setRoundedHours(null); } if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); + unset($data['notes']); } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } if (\array_key_exists('is_locked', $data) && null !== $data['is_locked']) { $object->setIsLocked($data['is_locked']); + unset($data['is_locked']); } elseif (\array_key_exists('is_locked', $data) && null === $data['is_locked']) { $object->setIsLocked(null); } if (\array_key_exists('locked_reason', $data) && null !== $data['locked_reason']) { $object->setLockedReason($data['locked_reason']); + unset($data['locked_reason']); } elseif (\array_key_exists('locked_reason', $data) && null === $data['locked_reason']) { $object->setLockedReason(null); } if (\array_key_exists('is_closed', $data) && null !== $data['is_closed']) { $object->setIsClosed($data['is_closed']); + unset($data['is_closed']); } elseif (\array_key_exists('is_closed', $data) && null === $data['is_closed']) { $object->setIsClosed(null); } if (\array_key_exists('is_billed', $data) && null !== $data['is_billed']) { $object->setIsBilled($data['is_billed']); + unset($data['is_billed']); } elseif (\array_key_exists('is_billed', $data) && null === $data['is_billed']) { $object->setIsBilled(null); } if (\array_key_exists('timer_started_at', $data) && null !== $data['timer_started_at']) { $object->setTimerStartedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['timer_started_at'])); + unset($data['timer_started_at']); } elseif (\array_key_exists('timer_started_at', $data) && null === $data['timer_started_at']) { $object->setTimerStartedAt(null); } if (\array_key_exists('started_time', $data) && null !== $data['started_time']) { $object->setStartedTime($data['started_time']); + unset($data['started_time']); } elseif (\array_key_exists('started_time', $data) && null === $data['started_time']) { $object->setStartedTime(null); } if (\array_key_exists('ended_time', $data) && null !== $data['ended_time']) { $object->setEndedTime($data['ended_time']); + unset($data['ended_time']); } elseif (\array_key_exists('ended_time', $data) && null === $data['ended_time']) { $object->setEndedTime(null); } if (\array_key_exists('is_running', $data) && null !== $data['is_running']) { $object->setIsRunning($data['is_running']); + unset($data['is_running']); } elseif (\array_key_exists('is_running', $data) && null === $data['is_running']) { $object->setIsRunning(null); } if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); + unset($data['billable']); } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } if (\array_key_exists('budgeted', $data) && null !== $data['budgeted']) { $object->setBudgeted($data['budgeted']); + unset($data['budgeted']); } elseif (\array_key_exists('budgeted', $data) && null === $data['budgeted']) { $object->setBudgeted(null); } if (\array_key_exists('billable_rate', $data) && null !== $data['billable_rate']) { $object->setBillableRate($data['billable_rate']); + unset($data['billable_rate']); } elseif (\array_key_exists('billable_rate', $data) && null === $data['billable_rate']) { $object->setBillableRate(null); } if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); + unset($data['cost_rate']); } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -204,90 +254,95 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getSpentDate()) { + if ($object->isInitialized('spentDate') && null !== $object->getSpentDate()) { $data['spent_date'] = $object->getSpentDate()->format('Y-m-d'); } - if (null !== $object->getUser()) { + if ($object->isInitialized('user') && null !== $object->getUser()) { $data['user'] = $this->normalizer->normalize($object->getUser(), 'json', $context); } - if (null !== $object->getUserAssignment()) { + if ($object->isInitialized('userAssignment') && null !== $object->getUserAssignment()) { $data['user_assignment'] = $this->normalizer->normalize($object->getUserAssignment(), 'json', $context); } - if (null !== $object->getClient()) { + if ($object->isInitialized('client') && null !== $object->getClient()) { $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } - if (null !== $object->getProject()) { + if ($object->isInitialized('project') && null !== $object->getProject()) { $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); } - if (null !== $object->getTask()) { + if ($object->isInitialized('task') && null !== $object->getTask()) { $data['task'] = $this->normalizer->normalize($object->getTask(), 'json', $context); } - if (null !== $object->getTaskAssignment()) { + if ($object->isInitialized('taskAssignment') && null !== $object->getTaskAssignment()) { $data['task_assignment'] = $this->normalizer->normalize($object->getTaskAssignment(), 'json', $context); } - if (null !== $object->getExternalReference()) { + if ($object->isInitialized('externalReference') && null !== $object->getExternalReference()) { $data['external_reference'] = $this->normalizer->normalize($object->getExternalReference(), 'json', $context); } - if (null !== $object->getInvoice()) { + if ($object->isInitialized('invoice') && null !== $object->getInvoice()) { $data['invoice'] = $this->normalizer->normalize($object->getInvoice(), 'json', $context); } - if (null !== $object->getHours()) { + if ($object->isInitialized('hours') && null !== $object->getHours()) { $data['hours'] = $object->getHours(); } - if (null !== $object->getHoursWithoutTimer()) { + if ($object->isInitialized('hoursWithoutTimer') && null !== $object->getHoursWithoutTimer()) { $data['hours_without_timer'] = $object->getHoursWithoutTimer(); } - if (null !== $object->getRoundedHours()) { + if ($object->isInitialized('roundedHours') && null !== $object->getRoundedHours()) { $data['rounded_hours'] = $object->getRoundedHours(); } - if (null !== $object->getNotes()) { + if ($object->isInitialized('notes') && null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } - if (null !== $object->getIsLocked()) { + if ($object->isInitialized('isLocked') && null !== $object->getIsLocked()) { $data['is_locked'] = $object->getIsLocked(); } - if (null !== $object->getLockedReason()) { + if ($object->isInitialized('lockedReason') && null !== $object->getLockedReason()) { $data['locked_reason'] = $object->getLockedReason(); } - if (null !== $object->getIsClosed()) { + if ($object->isInitialized('isClosed') && null !== $object->getIsClosed()) { $data['is_closed'] = $object->getIsClosed(); } - if (null !== $object->getIsBilled()) { + if ($object->isInitialized('isBilled') && null !== $object->getIsBilled()) { $data['is_billed'] = $object->getIsBilled(); } - if (null !== $object->getTimerStartedAt()) { + if ($object->isInitialized('timerStartedAt') && null !== $object->getTimerStartedAt()) { $data['timer_started_at'] = $object->getTimerStartedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getStartedTime()) { + if ($object->isInitialized('startedTime') && null !== $object->getStartedTime()) { $data['started_time'] = $object->getStartedTime(); } - if (null !== $object->getEndedTime()) { + if ($object->isInitialized('endedTime') && null !== $object->getEndedTime()) { $data['ended_time'] = $object->getEndedTime(); } - if (null !== $object->getIsRunning()) { + if ($object->isInitialized('isRunning') && null !== $object->getIsRunning()) { $data['is_running'] = $object->getIsRunning(); } - if (null !== $object->getBillable()) { + if ($object->isInitialized('billable') && null !== $object->getBillable()) { $data['billable'] = $object->getBillable(); } - if (null !== $object->getBudgeted()) { + if ($object->isInitialized('budgeted') && null !== $object->getBudgeted()) { $data['budgeted'] = $object->getBudgeted(); } - if (null !== $object->getBillableRate()) { + if ($object->isInitialized('billableRate') && null !== $object->getBillableRate()) { $data['billable_rate'] = $object->getBillableRate(); } - if (null !== $object->getCostRate()) { + if ($object->isInitialized('costRate') && null !== $object->getCostRate()) { $data['cost_rate'] = $object->getCostRate(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryProjectNormalizer.php b/generated/Normalizer/TimeEntryProjectNormalizer.php index 70d670c..c75225d 100644 --- a/generated/Normalizer/TimeEntryProjectNormalizer.php +++ b/generated/Normalizer/TimeEntryProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryProjectNormalizer implements DenormalizerInterface, NormalizerInt use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryTaskNormalizer.php b/generated/Normalizer/TimeEntryTaskNormalizer.php index 7473e6a..ac6d3b3 100644 --- a/generated/Normalizer/TimeEntryTaskNormalizer.php +++ b/generated/Normalizer/TimeEntryTaskNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryTaskNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeEntryUserNormalizer.php b/generated/Normalizer/TimeEntryUserNormalizer.php index e2c60aa..e7f3590 100644 --- a/generated/Normalizer/TimeEntryUserNormalizer.php +++ b/generated/Normalizer/TimeEntryUserNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeEntryUserNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeReportsResultNormalizer.php b/generated/Normalizer/TimeReportsResultNormalizer.php index 4ecfa3d..29d7bef 100644 --- a/generated/Normalizer/TimeReportsResultNormalizer.php +++ b/generated/Normalizer/TimeReportsResultNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeReportsResultNormalizer implements DenormalizerInterface, NormalizerIn use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult' === \get_class($data); } @@ -52,74 +54,113 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\TimeReportsResult(); + if (\array_key_exists('total_hours', $data) && \is_int($data['total_hours'])) { + $data['total_hours'] = (float) $data['total_hours']; + } + if (\array_key_exists('billable_hours', $data) && \is_int($data['billable_hours'])) { + $data['billable_hours'] = (float) $data['billable_hours']; + } + if (\array_key_exists('billable_amount', $data) && \is_int($data['billable_amount'])) { + $data['billable_amount'] = (float) $data['billable_amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); + unset($data['client_name']); } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); + unset($data['project_name']); } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); + unset($data['task_id']); } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } if (\array_key_exists('task_name', $data) && null !== $data['task_name']) { $object->setTaskName($data['task_name']); + unset($data['task_name']); } elseif (\array_key_exists('task_name', $data) && null === $data['task_name']) { $object->setTaskName(null); } if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); + unset($data['user_id']); } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } if (\array_key_exists('user_name', $data) && null !== $data['user_name']) { $object->setUserName($data['user_name']); + unset($data['user_name']); } elseif (\array_key_exists('user_name', $data) && null === $data['user_name']) { $object->setUserName(null); } + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { + $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { + $object->setWeeklyCapacity(null); + } + if (\array_key_exists('avatar_url', $data) && null !== $data['avatar_url']) { + $object->setAvatarUrl($data['avatar_url']); + unset($data['avatar_url']); + } elseif (\array_key_exists('avatar_url', $data) && null === $data['avatar_url']) { + $object->setAvatarUrl(null); + } if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); + unset($data['is_contractor']); } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } if (\array_key_exists('total_hours', $data) && null !== $data['total_hours']) { $object->setTotalHours($data['total_hours']); + unset($data['total_hours']); } elseif (\array_key_exists('total_hours', $data) && null === $data['total_hours']) { $object->setTotalHours(null); } if (\array_key_exists('billable_hours', $data) && null !== $data['billable_hours']) { $object->setBillableHours($data['billable_hours']); + unset($data['billable_hours']); } elseif (\array_key_exists('billable_hours', $data) && null === $data['billable_hours']) { $object->setBillableHours(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('billable_amount', $data) && null !== $data['billable_amount']) { $object->setBillableAmount($data['billable_amount']); + unset($data['billable_amount']); } elseif (\array_key_exists('billable_amount', $data) && null === $data['billable_amount']) { $object->setBillableAmount(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -133,45 +174,56 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getClientName()) { + if ($object->isInitialized('clientName') && null !== $object->getClientName()) { $data['client_name'] = $object->getClientName(); } - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getProjectName()) { + if ($object->isInitialized('projectName') && null !== $object->getProjectName()) { $data['project_name'] = $object->getProjectName(); } - if (null !== $object->getTaskId()) { + if ($object->isInitialized('taskId') && null !== $object->getTaskId()) { $data['task_id'] = $object->getTaskId(); } - if (null !== $object->getTaskName()) { + if ($object->isInitialized('taskName') && null !== $object->getTaskName()) { $data['task_name'] = $object->getTaskName(); } - if (null !== $object->getUserId()) { + if ($object->isInitialized('userId') && null !== $object->getUserId()) { $data['user_id'] = $object->getUserId(); } - if (null !== $object->getUserName()) { + if ($object->isInitialized('userName') && null !== $object->getUserName()) { $data['user_name'] = $object->getUserName(); } - if (null !== $object->getIsContractor()) { + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { + $data['weekly_capacity'] = $object->getWeeklyCapacity(); + } + if ($object->isInitialized('avatarUrl') && null !== $object->getAvatarUrl()) { + $data['avatar_url'] = $object->getAvatarUrl(); + } + if ($object->isInitialized('isContractor') && null !== $object->getIsContractor()) { $data['is_contractor'] = $object->getIsContractor(); } - if (null !== $object->getTotalHours()) { + if ($object->isInitialized('totalHours') && null !== $object->getTotalHours()) { $data['total_hours'] = $object->getTotalHours(); } - if (null !== $object->getBillableHours()) { + if ($object->isInitialized('billableHours') && null !== $object->getBillableHours()) { $data['billable_hours'] = $object->getBillableHours(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getBillableAmount()) { + if ($object->isInitialized('billableAmount') && null !== $object->getBillableAmount()) { $data['billable_amount'] = $object->getBillableAmount(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/TimeReportsResultsNormalizer.php b/generated/Normalizer/TimeReportsResultsNormalizer.php index 0d6092c..5b09845 100644 --- a/generated/Normalizer/TimeReportsResultsNormalizer.php +++ b/generated/Normalizer/TimeReportsResultsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class TimeReportsResultsNormalizer implements DenormalizerInterface, NormalizerI use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult', 'json', $context); } $object->setResults($values); + unset($data['results']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/UninvoicedReportResultNormalizer.php b/generated/Normalizer/UninvoicedReportResultNormalizer.php index dc43c59..f82a3ee 100644 --- a/generated/Normalizer/UninvoicedReportResultNormalizer.php +++ b/generated/Normalizer/UninvoicedReportResultNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UninvoicedReportResultNormalizer implements DenormalizerInterface, Normali use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult' === \get_class($data); } @@ -52,54 +54,80 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\UninvoicedReportResult(); + if (\array_key_exists('total_hours', $data) && \is_int($data['total_hours'])) { + $data['total_hours'] = (float) $data['total_hours']; + } + if (\array_key_exists('uninvoiced_hours', $data) && \is_int($data['uninvoiced_hours'])) { + $data['uninvoiced_hours'] = (float) $data['uninvoiced_hours']; + } + if (\array_key_exists('uninvoiced_expenses', $data) && \is_int($data['uninvoiced_expenses'])) { + $data['uninvoiced_expenses'] = (float) $data['uninvoiced_expenses']; + } + if (\array_key_exists('uninvoiced_amount', $data) && \is_int($data['uninvoiced_amount'])) { + $data['uninvoiced_amount'] = (float) $data['uninvoiced_amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); + unset($data['client_id']); } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); + unset($data['client_name']); } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); + unset($data['project_id']); } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); + unset($data['project_name']); } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); + unset($data['currency']); } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } if (\array_key_exists('total_hours', $data) && null !== $data['total_hours']) { $object->setTotalHours($data['total_hours']); + unset($data['total_hours']); } elseif (\array_key_exists('total_hours', $data) && null === $data['total_hours']) { $object->setTotalHours(null); } if (\array_key_exists('uninvoiced_hours', $data) && null !== $data['uninvoiced_hours']) { $object->setUninvoicedHours($data['uninvoiced_hours']); + unset($data['uninvoiced_hours']); } elseif (\array_key_exists('uninvoiced_hours', $data) && null === $data['uninvoiced_hours']) { $object->setUninvoicedHours(null); } if (\array_key_exists('uninvoiced_expenses', $data) && null !== $data['uninvoiced_expenses']) { $object->setUninvoicedExpenses($data['uninvoiced_expenses']); + unset($data['uninvoiced_expenses']); } elseif (\array_key_exists('uninvoiced_expenses', $data) && null === $data['uninvoiced_expenses']) { $object->setUninvoicedExpenses(null); } if (\array_key_exists('uninvoiced_amount', $data) && null !== $data['uninvoiced_amount']) { $object->setUninvoicedAmount($data['uninvoiced_amount']); + unset($data['uninvoiced_amount']); } elseif (\array_key_exists('uninvoiced_amount', $data) && null === $data['uninvoiced_amount']) { $object->setUninvoicedAmount(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -113,33 +141,38 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getClientId()) { + if ($object->isInitialized('clientId') && null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } - if (null !== $object->getClientName()) { + if ($object->isInitialized('clientName') && null !== $object->getClientName()) { $data['client_name'] = $object->getClientName(); } - if (null !== $object->getProjectId()) { + if ($object->isInitialized('projectId') && null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } - if (null !== $object->getProjectName()) { + if ($object->isInitialized('projectName') && null !== $object->getProjectName()) { $data['project_name'] = $object->getProjectName(); } - if (null !== $object->getCurrency()) { + if ($object->isInitialized('currency') && null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } - if (null !== $object->getTotalHours()) { + if ($object->isInitialized('totalHours') && null !== $object->getTotalHours()) { $data['total_hours'] = $object->getTotalHours(); } - if (null !== $object->getUninvoicedHours()) { + if ($object->isInitialized('uninvoicedHours') && null !== $object->getUninvoicedHours()) { $data['uninvoiced_hours'] = $object->getUninvoicedHours(); } - if (null !== $object->getUninvoicedExpenses()) { + if ($object->isInitialized('uninvoicedExpenses') && null !== $object->getUninvoicedExpenses()) { $data['uninvoiced_expenses'] = $object->getUninvoicedExpenses(); } - if (null !== $object->getUninvoicedAmount()) { + if ($object->isInitialized('uninvoicedAmount') && null !== $object->getUninvoicedAmount()) { $data['uninvoiced_amount'] = $object->getUninvoicedAmount(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/UninvoicedReportResultsNormalizer.php b/generated/Normalizer/UninvoicedReportResultsNormalizer.php index fe59c79..bcf5041 100644 --- a/generated/Normalizer/UninvoicedReportResultsNormalizer.php +++ b/generated/Normalizer/UninvoicedReportResultsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UninvoicedReportResultsNormalizer implements DenormalizerInterface, Normal use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult', 'json', $context); } $object->setResults($values); + unset($data['results']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/UserAssignmentNormalizer.php b/generated/Normalizer/UserAssignmentNormalizer.php index d6be743..3f58606 100644 --- a/generated/Normalizer/UserAssignmentNormalizer.php +++ b/generated/Normalizer/UserAssignmentNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UserAssignmentNormalizer implements DenormalizerInterface, NormalizerInter use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UserAssignment' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignment' === \get_class($data); } @@ -52,59 +54,80 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\UserAssignment(); + if (\array_key_exists('hourly_rate', $data) && \is_int($data['hourly_rate'])) { + $data['hourly_rate'] = (float) $data['hourly_rate']; + } + if (\array_key_exists('budget', $data) && \is_int($data['budget'])) { + $data['budget'] = (float) $data['budget']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject', 'json', $context)); + unset($data['project']); } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } if (\array_key_exists('user', $data) && null !== $data['user']) { $object->setUser($this->denormalizer->denormalize($data['user'], 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser', 'json', $context)); + unset($data['user']); } elseif (\array_key_exists('user', $data) && null === $data['user']) { $object->setUser(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); + unset($data['is_project_manager']); } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); + unset($data['use_default_rates']); } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); + unset($data['hourly_rate']); } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); + unset($data['budget']); } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -118,36 +141,41 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getProject()) { + if ($object->isInitialized('project') && null !== $object->getProject()) { $data['project'] = $this->normalizer->normalize($object->getProject(), 'json', $context); } - if (null !== $object->getUser()) { + if ($object->isInitialized('user') && null !== $object->getUser()) { $data['user'] = $this->normalizer->normalize($object->getUser(), 'json', $context); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getIsProjectManager()) { + if ($object->isInitialized('isProjectManager') && null !== $object->getIsProjectManager()) { $data['is_project_manager'] = $object->getIsProjectManager(); } - if (null !== $object->getUseDefaultRates()) { + if ($object->isInitialized('useDefaultRates') && null !== $object->getUseDefaultRates()) { $data['use_default_rates'] = $object->getUseDefaultRates(); } - if (null !== $object->getHourlyRate()) { + if ($object->isInitialized('hourlyRate') && null !== $object->getHourlyRate()) { $data['hourly_rate'] = $object->getHourlyRate(); } - if (null !== $object->getBudget()) { + if ($object->isInitialized('budget') && null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/UserAssignmentProjectNormalizer.php b/generated/Normalizer/UserAssignmentProjectNormalizer.php index cd56ab2..a2313e1 100644 --- a/generated/Normalizer/UserAssignmentProjectNormalizer.php +++ b/generated/Normalizer/UserAssignmentProjectNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UserAssignmentProjectNormalizer implements DenormalizerInterface, Normaliz use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject' === \get_class($data); } @@ -57,19 +59,27 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); + unset($data['code']); } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -83,15 +93,20 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } - if (null !== $object->getCode()) { + if ($object->isInitialized('code') && null !== $object->getCode()) { $data['code'] = $object->getCode(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/UserAssignmentUserNormalizer.php b/generated/Normalizer/UserAssignmentUserNormalizer.php index 0973284..d83c8e0 100644 --- a/generated/Normalizer/UserAssignmentUserNormalizer.php +++ b/generated/Normalizer/UserAssignmentUserNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UserAssignmentUserNormalizer implements DenormalizerInterface, NormalizerI use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser' === \get_class($data); } @@ -57,14 +59,21 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); + unset($data['name']); } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -78,12 +87,17 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getName()) { + if ($object->isInitialized('name') && null !== $object->getName()) { $data['name'] = $object->getName(); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/UserAssignmentsNormalizer.php b/generated/Normalizer/UserAssignmentsNormalizer.php index 4dbc958..8cbf75f 100644 --- a/generated/Normalizer/UserAssignmentsNormalizer.php +++ b/generated/Normalizer/UserAssignmentsNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UserAssignmentsNormalizer implements DenormalizerInterface, NormalizerInte use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UserAssignments' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignments' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json', $context); } $object->setUserAssignments($values); + unset($data['user_assignments']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/UserNormalizer.php b/generated/Normalizer/UserNormalizer.php index 8665314..5d8493d 100644 --- a/generated/Normalizer/UserNormalizer.php +++ b/generated/Normalizer/UserNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UserNormalizer implements DenormalizerInterface, NormalizerInterface, Deno use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\User' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\User' === \get_class($data); } @@ -52,66 +54,84 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\User(); + if (\array_key_exists('default_hourly_rate', $data) && \is_int($data['default_hourly_rate'])) { + $data['default_hourly_rate'] = (float) $data['default_hourly_rate']; + } + if (\array_key_exists('cost_rate', $data) && \is_int($data['cost_rate'])) { + $data['cost_rate'] = (float) $data['cost_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); + unset($data['id']); } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } if (\array_key_exists('telephone', $data) && null !== $data['telephone']) { $object->setTelephone($data['telephone']); + unset($data['telephone']); } elseif (\array_key_exists('telephone', $data) && null === $data['telephone']) { $object->setTelephone(null); } if (\array_key_exists('timezone', $data) && null !== $data['timezone']) { $object->setTimezone($data['timezone']); + unset($data['timezone']); } elseif (\array_key_exists('timezone', $data) && null === $data['timezone']) { $object->setTimezone(null); } if (\array_key_exists('has_access_to_all_future_projects', $data) && null !== $data['has_access_to_all_future_projects']) { $object->setHasAccessToAllFutureProjects($data['has_access_to_all_future_projects']); + unset($data['has_access_to_all_future_projects']); } elseif (\array_key_exists('has_access_to_all_future_projects', $data) && null === $data['has_access_to_all_future_projects']) { $object->setHasAccessToAllFutureProjects(null); } if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); + unset($data['is_contractor']); } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); + unset($data['default_hourly_rate']); } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); + unset($data['cost_rate']); } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } @@ -121,6 +141,7 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setRoles($values); + unset($data['roles']); } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { $object->setRoles(null); } @@ -130,24 +151,33 @@ public function denormalize($data, $class, $format = null, array $context = []) $values_1[] = $value_1; } $object->setAccessRoles($values_1); + unset($data['access_roles']); } elseif (\array_key_exists('access_roles', $data) && null === $data['access_roles']) { $object->setAccessRoles(null); } if (\array_key_exists('avatar_url', $data) && null !== $data['avatar_url']) { $object->setAvatarUrl($data['avatar_url']); + unset($data['avatar_url']); } elseif (\array_key_exists('avatar_url', $data) && null === $data['avatar_url']) { $object->setAvatarUrl(null); } if (\array_key_exists('created_at', $data) && null !== $data['created_at']) { $object->setCreatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['created_at'])); + unset($data['created_at']); } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } if (\array_key_exists('updated_at', $data) && null !== $data['updated_at']) { $object->setUpdatedAt(\DateTime::createFromFormat('Y-m-d\\TH:i:s\\Z', $data['updated_at'])); + unset($data['updated_at']); } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } return $object; } @@ -161,65 +191,70 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getId()) { + if ($object->isInitialized('id') && null !== $object->getId()) { $data['id'] = $object->getId(); } - if (null !== $object->getFirstName()) { + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { $data['first_name'] = $object->getFirstName(); } - if (null !== $object->getLastName()) { + if ($object->isInitialized('lastName') && null !== $object->getLastName()) { $data['last_name'] = $object->getLastName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } - if (null !== $object->getTelephone()) { + if ($object->isInitialized('telephone') && null !== $object->getTelephone()) { $data['telephone'] = $object->getTelephone(); } - if (null !== $object->getTimezone()) { + if ($object->isInitialized('timezone') && null !== $object->getTimezone()) { $data['timezone'] = $object->getTimezone(); } - if (null !== $object->getHasAccessToAllFutureProjects()) { + if ($object->isInitialized('hasAccessToAllFutureProjects') && null !== $object->getHasAccessToAllFutureProjects()) { $data['has_access_to_all_future_projects'] = $object->getHasAccessToAllFutureProjects(); } - if (null !== $object->getIsContractor()) { + if ($object->isInitialized('isContractor') && null !== $object->getIsContractor()) { $data['is_contractor'] = $object->getIsContractor(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getWeeklyCapacity()) { + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { $data['weekly_capacity'] = $object->getWeeklyCapacity(); } - if (null !== $object->getDefaultHourlyRate()) { + if ($object->isInitialized('defaultHourlyRate') && null !== $object->getDefaultHourlyRate()) { $data['default_hourly_rate'] = $object->getDefaultHourlyRate(); } - if (null !== $object->getCostRate()) { + if ($object->isInitialized('costRate') && null !== $object->getCostRate()) { $data['cost_rate'] = $object->getCostRate(); } - if (null !== $object->getRoles()) { + if ($object->isInitialized('roles') && null !== $object->getRoles()) { $values = []; foreach ($object->getRoles() as $value) { $values[] = $value; } $data['roles'] = $values; } - if (null !== $object->getAccessRoles()) { + if ($object->isInitialized('accessRoles') && null !== $object->getAccessRoles()) { $values_1 = []; foreach ($object->getAccessRoles() as $value_1) { $values_1[] = $value_1; } $data['access_roles'] = $values_1; } - if (null !== $object->getAvatarUrl()) { + if ($object->isInitialized('avatarUrl') && null !== $object->getAvatarUrl()) { $data['avatar_url'] = $object->getAvatarUrl(); } - if (null !== $object->getCreatedAt()) { + if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) { $data['created_at'] = $object->getCreatedAt()->format('Y-m-d\\TH:i:s\\Z'); } - if (null !== $object->getUpdatedAt()) { + if ($object->isInitialized('updatedAt') && null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } return $data; } diff --git a/generated/Normalizer/UsersNormalizer.php b/generated/Normalizer/UsersNormalizer.php index de714c6..6997e19 100644 --- a/generated/Normalizer/UsersNormalizer.php +++ b/generated/Normalizer/UsersNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UsersNormalizer implements DenormalizerInterface, NormalizerInterface, Den use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\Users' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Users' === \get_class($data); } @@ -61,31 +63,44 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\User', 'json', $context); } $object->setUsers($values); + unset($data['users']); } if (\array_key_exists('per_page', $data)) { $object->setPerPage($data['per_page']); + unset($data['per_page']); } if (\array_key_exists('total_pages', $data)) { $object->setTotalPages($data['total_pages']); + unset($data['total_pages']); } if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); + unset($data['total_entries']); } if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); + unset($data['next_page']); } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); + unset($data['previous_page']); } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { $object->setPage($data['page']); + unset($data['page']); } if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); + unset($data['links']); + } + foreach ($data as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_1; + } } return $object; @@ -112,6 +127,11 @@ public function normalize($object, $format = null, array $context = []) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + foreach ($object as $key => $value_1) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_1; + } + } return $data; } diff --git a/generated/Normalizer/UsersPostBodyNormalizer.php b/generated/Normalizer/UsersPostBodyNormalizer.php index 15de8ea..1de5422 100644 --- a/generated/Normalizer/UsersPostBodyNormalizer.php +++ b/generated/Normalizer/UsersPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UsersPostBodyNormalizer implements DenormalizerInterface, NormalizerInterf use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody' === \get_class($data); } @@ -52,56 +54,72 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\UsersPostBody(); + if (\array_key_exists('default_hourly_rate', $data) && \is_int($data['default_hourly_rate'])) { + $data['default_hourly_rate'] = (float) $data['default_hourly_rate']; + } + if (\array_key_exists('cost_rate', $data) && \is_int($data['cost_rate'])) { + $data['cost_rate'] = (float) $data['cost_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } if (\array_key_exists('timezone', $data) && null !== $data['timezone']) { $object->setTimezone($data['timezone']); + unset($data['timezone']); } elseif (\array_key_exists('timezone', $data) && null === $data['timezone']) { $object->setTimezone(null); } if (\array_key_exists('has_access_to_all_future_projects', $data) && null !== $data['has_access_to_all_future_projects']) { $object->setHasAccessToAllFutureProjects($data['has_access_to_all_future_projects']); + unset($data['has_access_to_all_future_projects']); } elseif (\array_key_exists('has_access_to_all_future_projects', $data) && null === $data['has_access_to_all_future_projects']) { $object->setHasAccessToAllFutureProjects(null); } if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); + unset($data['is_contractor']); } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); + unset($data['default_hourly_rate']); } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); + unset($data['cost_rate']); } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } @@ -111,6 +129,7 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setRoles($values); + unset($data['roles']); } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { $object->setRoles(null); } @@ -120,9 +139,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values_1[] = $value_1; } $object->setAccessRoles($values_1); + unset($data['access_roles']); } elseif (\array_key_exists('access_roles', $data) && null === $data['access_roles']) { $object->setAccessRoles(null); } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } return $object; } @@ -139,41 +164,46 @@ public function normalize($object, $format = null, array $context = []) $data['first_name'] = $object->getFirstName(); $data['last_name'] = $object->getLastName(); $data['email'] = $object->getEmail(); - if (null !== $object->getTimezone()) { + if ($object->isInitialized('timezone') && null !== $object->getTimezone()) { $data['timezone'] = $object->getTimezone(); } - if (null !== $object->getHasAccessToAllFutureProjects()) { + if ($object->isInitialized('hasAccessToAllFutureProjects') && null !== $object->getHasAccessToAllFutureProjects()) { $data['has_access_to_all_future_projects'] = $object->getHasAccessToAllFutureProjects(); } - if (null !== $object->getIsContractor()) { + if ($object->isInitialized('isContractor') && null !== $object->getIsContractor()) { $data['is_contractor'] = $object->getIsContractor(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getWeeklyCapacity()) { + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { $data['weekly_capacity'] = $object->getWeeklyCapacity(); } - if (null !== $object->getDefaultHourlyRate()) { + if ($object->isInitialized('defaultHourlyRate') && null !== $object->getDefaultHourlyRate()) { $data['default_hourly_rate'] = $object->getDefaultHourlyRate(); } - if (null !== $object->getCostRate()) { + if ($object->isInitialized('costRate') && null !== $object->getCostRate()) { $data['cost_rate'] = $object->getCostRate(); } - if (null !== $object->getRoles()) { + if ($object->isInitialized('roles') && null !== $object->getRoles()) { $values = []; foreach ($object->getRoles() as $value) { $values[] = $value; } $data['roles'] = $values; } - if (null !== $object->getAccessRoles()) { + if ($object->isInitialized('accessRoles') && null !== $object->getAccessRoles()) { $values_1 = []; foreach ($object->getAccessRoles() as $value_1) { $values_1[] = $value_1; } $data['access_roles'] = $values_1; } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } return $data; } diff --git a/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php b/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php index 298de0f..3d3c179 100644 --- a/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UsersUserIdBillableRatesPostBodyNormalizer implements DenormalizerInterfac use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody' === \get_class($data); } @@ -52,19 +54,29 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -79,9 +91,14 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['amount'] = $object->getAmount(); - if (null !== $object->getStartDate()) { + if ($object->isInitialized('startDate') && null !== $object->getStartDate()) { $data['start_date'] = $object->getStartDate()->format('Y-m-d'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php b/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php index 9c18bb6..a091001 100644 --- a/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UsersUserIdCostRatesPostBodyNormalizer implements DenormalizerInterface, N use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody' === \get_class($data); } @@ -52,19 +54,29 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody(); + if (\array_key_exists('amount', $data) && \is_int($data['amount'])) { + $data['amount'] = (float) $data['amount']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); + unset($data['amount']); } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } if (\array_key_exists('start_date', $data) && null !== $data['start_date']) { $object->setStartDate(\DateTime::createFromFormat('Y-m-d', $data['start_date'])->setTime(0, 0, 0)); + unset($data['start_date']); } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -79,9 +91,14 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['amount'] = $object->getAmount(); - if (null !== $object->getStartDate()) { + if ($object->isInitialized('startDate') && null !== $object->getStartDate()) { $data['start_date'] = $object->getStartDate()->format('Y-m-d'); } + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php b/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php index 018bbf0..ebfaea4 100644 --- a/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UsersUserIdPatchBodyNormalizer implements DenormalizerInterface, Normalize use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody' === \get_class($data); } @@ -52,56 +54,72 @@ public function denormalize($data, $class, $format = null, array $context = []) return new Reference($data['$recursiveRef'], $context['document-origin']); } $object = new \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody(); + if (\array_key_exists('default_hourly_rate', $data) && \is_int($data['default_hourly_rate'])) { + $data['default_hourly_rate'] = (float) $data['default_hourly_rate']; + } + if (\array_key_exists('cost_rate', $data) && \is_int($data['cost_rate'])) { + $data['cost_rate'] = (float) $data['cost_rate']; + } if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); + unset($data['first_name']); } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); + unset($data['last_name']); } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); + unset($data['email']); } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } if (\array_key_exists('timezone', $data) && null !== $data['timezone']) { $object->setTimezone($data['timezone']); + unset($data['timezone']); } elseif (\array_key_exists('timezone', $data) && null === $data['timezone']) { $object->setTimezone(null); } if (\array_key_exists('has_access_to_all_future_projects', $data) && null !== $data['has_access_to_all_future_projects']) { $object->setHasAccessToAllFutureProjects($data['has_access_to_all_future_projects']); + unset($data['has_access_to_all_future_projects']); } elseif (\array_key_exists('has_access_to_all_future_projects', $data) && null === $data['has_access_to_all_future_projects']) { $object->setHasAccessToAllFutureProjects(null); } if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); + unset($data['is_contractor']); } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); + unset($data['is_active']); } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); + unset($data['weekly_capacity']); } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); + unset($data['default_hourly_rate']); } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); + unset($data['cost_rate']); } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } @@ -111,6 +129,7 @@ public function denormalize($data, $class, $format = null, array $context = []) $values[] = $value; } $object->setRoles($values); + unset($data['roles']); } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { $object->setRoles(null); } @@ -120,9 +139,15 @@ public function denormalize($data, $class, $format = null, array $context = []) $values_1[] = $value_1; } $object->setAccessRoles($values_1); + unset($data['access_roles']); } elseif (\array_key_exists('access_roles', $data) && null === $data['access_roles']) { $object->setAccessRoles(null); } + foreach ($data as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value_2; + } + } return $object; } @@ -136,50 +161,55 @@ public function denormalize($data, $class, $format = null, array $context = []) public function normalize($object, $format = null, array $context = []) { $data = []; - if (null !== $object->getFirstName()) { + if ($object->isInitialized('firstName') && null !== $object->getFirstName()) { $data['first_name'] = $object->getFirstName(); } - if (null !== $object->getLastName()) { + if ($object->isInitialized('lastName') && null !== $object->getLastName()) { $data['last_name'] = $object->getLastName(); } - if (null !== $object->getEmail()) { + if ($object->isInitialized('email') && null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } - if (null !== $object->getTimezone()) { + if ($object->isInitialized('timezone') && null !== $object->getTimezone()) { $data['timezone'] = $object->getTimezone(); } - if (null !== $object->getHasAccessToAllFutureProjects()) { + if ($object->isInitialized('hasAccessToAllFutureProjects') && null !== $object->getHasAccessToAllFutureProjects()) { $data['has_access_to_all_future_projects'] = $object->getHasAccessToAllFutureProjects(); } - if (null !== $object->getIsContractor()) { + if ($object->isInitialized('isContractor') && null !== $object->getIsContractor()) { $data['is_contractor'] = $object->getIsContractor(); } - if (null !== $object->getIsActive()) { + if ($object->isInitialized('isActive') && null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } - if (null !== $object->getWeeklyCapacity()) { + if ($object->isInitialized('weeklyCapacity') && null !== $object->getWeeklyCapacity()) { $data['weekly_capacity'] = $object->getWeeklyCapacity(); } - if (null !== $object->getDefaultHourlyRate()) { + if ($object->isInitialized('defaultHourlyRate') && null !== $object->getDefaultHourlyRate()) { $data['default_hourly_rate'] = $object->getDefaultHourlyRate(); } - if (null !== $object->getCostRate()) { + if ($object->isInitialized('costRate') && null !== $object->getCostRate()) { $data['cost_rate'] = $object->getCostRate(); } - if (null !== $object->getRoles()) { + if ($object->isInitialized('roles') && null !== $object->getRoles()) { $values = []; foreach ($object->getRoles() as $value) { $values[] = $value; } $data['roles'] = $values; } - if (null !== $object->getAccessRoles()) { + if ($object->isInitialized('accessRoles') && null !== $object->getAccessRoles()) { $values_1 = []; foreach ($object->getAccessRoles() as $value_1) { $values_1[] = $value_1; } $data['access_roles'] = $values_1; } + foreach ($object as $key => $value_2) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value_2; + } + } return $data; } diff --git a/generated/Normalizer/UsersUserIdTeammatesPatchBodyNormalizer.php b/generated/Normalizer/UsersUserIdTeammatesPatchBodyNormalizer.php index 9e875bb..ad184b8 100644 --- a/generated/Normalizer/UsersUserIdTeammatesPatchBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdTeammatesPatchBodyNormalizer.php @@ -13,6 +13,7 @@ use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; +use JoliCode\Harvest\Api\Runtime\Normalizer\ValidatorTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; @@ -25,13 +26,14 @@ class UsersUserIdTeammatesPatchBodyNormalizer implements DenormalizerInterface, use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; + use ValidatorTrait; - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdTeammatesPatchBody' === $type; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization($data, $format = null, array $context = []): bool { return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdTeammatesPatchBody' === \get_class($data); } @@ -57,9 +59,15 @@ public function denormalize($data, $class, $format = null, array $context = []) } if (\array_key_exists('teammate_ids', $data) && null !== $data['teammate_ids']) { $object->setTeammateIds($data['teammate_ids']); + unset($data['teammate_ids']); } elseif (\array_key_exists('teammate_ids', $data) && null === $data['teammate_ids']) { $object->setTeammateIds(null); } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } return $object; } @@ -74,6 +82,11 @@ public function normalize($object, $format = null, array $context = []) { $data = []; $data['teammate_ids'] = $object->getTeammateIds(); + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } return $data; } diff --git a/generated/Runtime/Client/BaseEndpoint.php b/generated/Runtime/Client/BaseEndpoint.php index 2078471..e37d09f 100644 --- a/generated/Runtime/Client/BaseEndpoint.php +++ b/generated/Runtime/Client/BaseEndpoint.php @@ -12,6 +12,7 @@ namespace JoliCode\Harvest\Api\Runtime\Client; use Http\Message\MultipartStream\MultipartStreamBuilder; +use Psr\Http\Message\ResponseInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Serializer\SerializerInterface; @@ -44,7 +45,7 @@ public function getHeaders(array $baseHeaders = []): array return array_merge($this->getExtraHeaders(), $baseHeaders, $this->getHeadersOptionsResolver()->resolve($this->headerParameters)); } - abstract protected function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); + abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null); protected function getExtraHeaders(): array { diff --git a/generated/Runtime/Client/EndpointTrait.php b/generated/Runtime/Client/EndpointTrait.php index cccc956..bfec90e 100644 --- a/generated/Runtime/Client/EndpointTrait.php +++ b/generated/Runtime/Client/EndpointTrait.php @@ -20,8 +20,8 @@ public function parseResponse(ResponseInterface $response, SerializerInterface $ { $contentType = $response->hasHeader('Content-Type') ? current($response->getHeader('Content-Type')) : null; - return $this->transformResponseBody((string) $response->getBody(), $response->getStatusCode(), $serializer, $contentType); + return $this->transformResponseBody($response, $serializer, $contentType); } - abstract protected function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); + abstract protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null); } diff --git a/generated/Runtime/Normalizer/ValidationException.php b/generated/Runtime/Normalizer/ValidationException.php new file mode 100644 index 0000000..766ba58 --- /dev/null +++ b/generated/Runtime/Normalizer/ValidationException.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Harvest\Api\Runtime\Normalizer; + +use Symfony\Component\Validator\ConstraintViolationListInterface; + +class ValidationException extends \RuntimeException +{ + /** @var ConstraintViolationListInterface */ + private $violationList; + + public function __construct(ConstraintViolationListInterface $violationList) + { + $this->violationList = $violationList; + parent::__construct(sprintf('Model validation failed with %d errors.', $violationList->count()), 400); + } + + public function getViolationList(): ConstraintViolationListInterface + { + return $this->violationList; + } +} diff --git a/generated/Runtime/Normalizer/ValidatorTrait.php b/generated/Runtime/Normalizer/ValidatorTrait.php new file mode 100644 index 0000000..c6913be --- /dev/null +++ b/generated/Runtime/Normalizer/ValidatorTrait.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace JoliCode\Harvest\Api\Runtime\Normalizer; + +use Symfony\Component\Validator\Constraint; + +trait ValidatorTrait +{ + protected function validate(array $data, Constraint $constraint): void + { + $validator = \Symfony\Component\Validator\Validation::createValidator(); + $violations = $validator->validate($data, $constraint); + if ($violations->count() > 0) { + throw new ValidationException($violations); + } + } +}