From 3ddd3cf4025f7b2d455dadd0ac1a2e4922e85df0 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Thu, 4 Aug 2022 12:20:10 +0200 Subject: [PATCH 1/3] upgrade to jane 7.3 --- .gitignore | 4 +- .php_cs => .php-cs-fixer.php | 35 +- composer.json | 10 +- .../AccountAuthAuthentication.php | 19 +- .../BearerAuthAuthentication.php | 19 +- generated/Client.php | 1529 +++++++++-------- generated/Endpoint/ClientsExpensesReport.php | 74 +- generated/Endpoint/ClientsTimeReport.php | 74 +- generated/Endpoint/CreateBillableRate.php | 65 +- generated/Endpoint/CreateClient.php | 52 +- generated/Endpoint/CreateContact.php | 52 +- generated/Endpoint/CreateCostRate.php | 65 +- generated/Endpoint/CreateEstimate.php | 52 +- .../Endpoint/CreateEstimateItemCategory.php | 52 +- generated/Endpoint/CreateEstimateMessage.php | 55 +- generated/Endpoint/CreateExpense.php | 52 +- generated/Endpoint/CreateExpenseCategory.php | 52 +- generated/Endpoint/CreateInvoice.php | 52 +- .../Endpoint/CreateInvoiceItemCategory.php | 52 +- generated/Endpoint/CreateInvoiceMessage.php | 55 +- generated/Endpoint/CreateInvoicePayment.php | 55 +- generated/Endpoint/CreateProject.php | 52 +- generated/Endpoint/CreateRole.php | 52 +- generated/Endpoint/CreateTask.php | 52 +- generated/Endpoint/CreateTaskAssignment.php | 55 +- generated/Endpoint/CreateTimeEntry.php | 58 +- generated/Endpoint/CreateUser.php | 52 +- generated/Endpoint/CreateUserAssignment.php | 55 +- generated/Endpoint/DeleteClient.php | 49 +- generated/Endpoint/DeleteContact.php | 49 +- generated/Endpoint/DeleteEstimate.php | 49 +- .../Endpoint/DeleteEstimateItemCategory.php | 49 +- generated/Endpoint/DeleteEstimateMessage.php | 50 +- generated/Endpoint/DeleteExpense.php | 49 +- generated/Endpoint/DeleteExpenseCategory.php | 49 +- generated/Endpoint/DeleteInvoice.php | 49 +- .../Endpoint/DeleteInvoiceItemCategory.php | 49 +- generated/Endpoint/DeleteInvoiceMessage.php | 50 +- generated/Endpoint/DeleteInvoicePayment.php | 50 +- generated/Endpoint/DeleteProject.php | 54 +- generated/Endpoint/DeleteRole.php | 49 +- generated/Endpoint/DeleteTask.php | 49 +- generated/Endpoint/DeleteTaskAssignment.php | 50 +- generated/Endpoint/DeleteTimeEntry.php | 49 +- .../DeleteTimeEntryExternalReference.php | 49 +- generated/Endpoint/DeleteUser.php | 49 +- generated/Endpoint/DeleteUserAssignment.php | 50 +- .../Endpoint/ExpenseCategoriesReport.php | 74 +- .../Endpoint/ListActiveProjectAssignments.php | 88 +- ...nmentsForTheCurrentlyAuthenticatedUser.php | 81 +- .../ListBillableRatesForSpecificUser.php | 84 +- generated/Endpoint/ListClients.php | 91 +- generated/Endpoint/ListContacts.php | 89 +- .../Endpoint/ListCostRatesForSpecificUser.php | 84 +- .../Endpoint/ListEstimateItemCategories.php | 85 +- generated/Endpoint/ListEstimates.php | 101 +- generated/Endpoint/ListExpenseCategories.php | 91 +- generated/Endpoint/ListExpenses.php | 111 +- .../Endpoint/ListInvoiceItemCategories.php | 85 +- generated/Endpoint/ListInvoices.php | 105 +- .../Endpoint/ListMessagesForEstimate.php | 88 +- generated/Endpoint/ListMessagesForInvoice.php | 88 +- generated/Endpoint/ListPaymentsForInvoice.php | 88 +- generated/Endpoint/ListProjects.php | 95 +- generated/Endpoint/ListRoles.php | 81 +- generated/Endpoint/ListTaskAssignments.php | 91 +- .../ListTaskAssignmentsForSpecificProject.php | 94 +- generated/Endpoint/ListTasks.php | 91 +- generated/Endpoint/ListTimeEntries.php | 125 +- generated/Endpoint/ListUserAssignments.php | 95 +- .../ListUserAssignmentsForSpecificProject.php | 98 +- generated/Endpoint/ListUsers.php | 91 +- generated/Endpoint/ProjectBudgetReport.php | 68 +- generated/Endpoint/ProjectsExpensesReport.php | 74 +- generated/Endpoint/ProjectsTimeReport.php | 74 +- .../Endpoint/RestartStoppedTimeEntry.php | 51 +- generated/Endpoint/RetrieveBillableRate.php | 52 +- generated/Endpoint/RetrieveClient.php | 51 +- generated/Endpoint/RetrieveCompany.php | 44 +- generated/Endpoint/RetrieveContact.php | 51 +- generated/Endpoint/RetrieveCostRate.php | 52 +- generated/Endpoint/RetrieveEstimate.php | 51 +- .../Endpoint/RetrieveEstimateItemCategory.php | 51 +- generated/Endpoint/RetrieveExpense.php | 51 +- .../Endpoint/RetrieveExpenseCategory.php | 51 +- generated/Endpoint/RetrieveInvoice.php | 51 +- .../Endpoint/RetrieveInvoiceItemCategory.php | 51 +- generated/Endpoint/RetrieveProject.php | 51 +- generated/Endpoint/RetrieveRole.php | 51 +- generated/Endpoint/RetrieveTask.php | 51 +- generated/Endpoint/RetrieveTaskAssignment.php | 52 +- .../RetrieveTheCurrentlyAuthenticatedUser.php | 44 +- generated/Endpoint/RetrieveTimeEntry.php | 51 +- generated/Endpoint/RetrieveUser.php | 51 +- generated/Endpoint/RetrieveUserAssignment.php | 52 +- generated/Endpoint/StopRunningTimeEntry.php | 51 +- generated/Endpoint/TasksReport.php | 74 +- generated/Endpoint/TeamExpensesReport.php | 74 +- generated/Endpoint/TeamTimeReport.php | 74 +- generated/Endpoint/UninvoicedReport.php | 89 +- generated/Endpoint/UpdateClient.php | 55 +- generated/Endpoint/UpdateCompany.php | 52 +- generated/Endpoint/UpdateContact.php | 55 +- generated/Endpoint/UpdateEstimate.php | 55 +- .../Endpoint/UpdateEstimateItemCategory.php | 55 +- generated/Endpoint/UpdateExpense.php | 55 +- generated/Endpoint/UpdateExpenseCategory.php | 55 +- generated/Endpoint/UpdateInvoice.php | 55 +- .../Endpoint/UpdateInvoiceItemCategory.php | 55 +- generated/Endpoint/UpdateProject.php | 55 +- generated/Endpoint/UpdateRole.php | 55 +- generated/Endpoint/UpdateTask.php | 55 +- generated/Endpoint/UpdateTaskAssignment.php | 56 +- generated/Endpoint/UpdateTimeEntry.php | 55 +- generated/Endpoint/UpdateUser.php | 55 +- generated/Endpoint/UpdateUserAssignment.php | 56 +- generated/Model/BillableRate.php | 89 +- generated/Model/BillableRates.php | 173 +- generated/Model/Client.php | 121 +- generated/Model/Clients.php | 173 +- generated/Model/ClientsClientIdPatchBody.php | 69 +- generated/Model/ClientsPostBody.php | 69 +- generated/Model/Companies.php | 173 +- generated/Model/Company.php | 277 ++- generated/Model/CompanyPatchBody.php | 37 +- generated/Model/Contact.php | 154 +- generated/Model/ContactClient.php | 53 +- generated/Model/Contacts.php | 173 +- .../Model/ContactsContactIdPatchBody.php | 115 +- generated/Model/ContactsPostBody.php | 115 +- generated/Model/CostRate.php | 89 +- generated/Model/CostRates.php | 173 +- generated/Model/Error.php | 53 +- generated/Model/Estimate.php | 325 ++-- generated/Model/EstimateClient.php | 53 +- generated/Model/EstimateCreator.php | 53 +- generated/Model/EstimateItemCategories.php | 173 +- ...egoriesEstimateItemCategoryIdPatchBody.php | 24 +- .../Model/EstimateItemCategoriesPostBody.php | 24 +- generated/Model/EstimateItemCategory.php | 63 +- generated/Model/EstimateLineItem.php | 115 +- generated/Model/EstimateLineItems.php | 173 +- generated/Model/EstimateMessage.php | 163 +- generated/Model/EstimateMessageRecipient.php | 37 +- generated/Model/EstimateMessageRecipients.php | 173 +- generated/Model/EstimateMessages.php | 173 +- generated/Model/Estimates.php | 173 +- .../EstimatesEstimateIdMessagesPostBody.php | 72 +- ...timateIdMessagesPostBodyRecipientsItem.php | 37 +- .../Model/EstimatesEstimateIdPatchBody.php | 162 +- ...imatesEstimateIdPatchBodyLineItemsItem.php | 102 +- generated/Model/EstimatesPostBody.php | 162 +- .../Model/EstimatesPostBodyLineItemsItem.php | 89 +- generated/Model/Expense.php | 266 ++- generated/Model/ExpenseCategories.php | 173 +- ...seCategoriesExpenseCategoryIdPatchBody.php | 63 +- generated/Model/ExpenseCategoriesPostBody.php | 63 +- generated/Model/ExpenseCategory.php | 102 +- generated/Model/ExpenseClient.php | 74 +- generated/Model/ExpenseExpenseCategory.php | 95 +- generated/Model/ExpenseInvoice.php | 53 +- generated/Model/ExpenseProject.php | 74 +- generated/Model/ExpenseReceipt.php | 95 +- generated/Model/ExpenseReportsResult.php | 167 +- generated/Model/ExpenseReportsResults.php | 173 +- generated/Model/ExpenseUser.php | 53 +- generated/Model/Expenses.php | 173 +- .../Model/ExpensesExpenseIdPatchBody.php | 128 +- generated/Model/ExpensesPostBody.php | 128 +- generated/Model/Invoice.php | 442 ++--- generated/Model/InvoiceClient.php | 53 +- generated/Model/InvoiceCreator.php | 53 +- generated/Model/InvoiceEstimate.php | 32 +- generated/Model/InvoiceItemCategories.php | 173 +- ...tegoriesInvoiceItemCategoryIdPatchBody.php | 24 +- .../Model/InvoiceItemCategoriesPostBody.php | 24 +- generated/Model/InvoiceItemCategory.php | 89 +- generated/Model/InvoiceLineItem.php | 128 +- generated/Model/InvoiceLineItemProject.php | 74 +- generated/Model/InvoiceLineItems.php | 173 +- generated/Model/InvoiceMessage.php | 228 +-- generated/Model/InvoiceMessageRecipient.php | 37 +- generated/Model/InvoiceMessageRecipients.php | 173 +- generated/Model/InvoiceMessages.php | 173 +- generated/Model/InvoicePayment.php | 154 +- .../Model/InvoicePaymentPaymentGateway.php | 53 +- generated/Model/InvoicePayments.php | 173 +- generated/Model/InvoiceRetainer.php | 32 +- generated/Model/Invoices.php | 173 +- .../InvoicesInvoiceIdMessagesPostBody.php | 111 +- ...nvoiceIdMessagesPostBodyRecipientsItem.php | 37 +- .../Model/InvoicesInvoiceIdPatchBody.php | 214 +-- ...nvoicesInvoiceIdPatchBodyLineItemsItem.php | 115 +- .../InvoicesInvoiceIdPaymentsPostBody.php | 63 +- generated/Model/InvoicesPostBody.php | 233 ++- .../Model/InvoicesPostBodyLineItemsImport.php | 46 +- ...nvoicesPostBodyLineItemsImportExpenses.php | 63 +- .../InvoicesPostBodyLineItemsImportTime.php | 50 +- .../Model/InvoicesPostBodyLineItemsItem.php | 102 +- generated/Model/PaginationLinks.php | 87 +- generated/Model/Project.php | 323 ++-- generated/Model/ProjectAssignment.php | 150 +- generated/Model/ProjectAssignmentClient.php | 53 +- generated/Model/ProjectAssignmentProject.php | 74 +- generated/Model/ProjectAssignments.php | 173 +- generated/Model/ProjectBudgetReportResult.php | 141 +- .../Model/ProjectBudgetReportResults.php | 173 +- generated/Model/ProjectClient.php | 74 +- generated/Model/Projects.php | 173 +- generated/Model/ProjectsPostBody.php | 271 ++- .../Model/ProjectsProjectIdPatchBody.php | 271 ++- ...ojectsProjectIdTaskAssignmentsPostBody.php | 76 +- ...skAssignmentsTaskAssignmentIdPatchBody.php | 63 +- ...ojectsProjectIdUserAssignmentsPostBody.php | 89 +- ...erAssignmentsUserAssignmentIdPatchBody.php | 76 +- generated/Model/Role.php | 72 +- generated/Model/Roles.php | 173 +- generated/Model/RolesPostBody.php | 33 +- generated/Model/RolesRoleIdPatchBody.php | 33 +- generated/Model/Task.php | 115 +- generated/Model/TaskAssignment.php | 128 +- generated/Model/TaskAssignmentProject.php | 74 +- generated/Model/TaskAssignmentTask.php | 53 +- generated/Model/TaskAssignments.php | 173 +- generated/Model/Tasks.php | 173 +- generated/Model/TasksPostBody.php | 76 +- generated/Model/TasksTaskIdPatchBody.php | 76 +- generated/Model/TimeEntries.php | 173 +- generated/Model/TimeEntriesPostBody.php | 128 +- .../TimeEntriesPostBodyExternalReference.php | 95 +- .../Model/TimeEntriesTimeEntryIdPatchBody.php | 115 +- ...sTimeEntryIdPatchBodyExternalReference.php | 95 +- generated/Model/TimeEntry.php | 391 ++--- generated/Model/TimeEntryClient.php | 53 +- .../Model/TimeEntryExternalReference.php | 137 +- generated/Model/TimeEntryInvoice.php | 53 +- generated/Model/TimeEntryProject.php | 53 +- generated/Model/TimeEntryTask.php | 53 +- generated/Model/TimeEntryUser.php | 53 +- generated/Model/TimeReportsResult.php | 180 +- generated/Model/TimeReportsResults.php | 173 +- generated/Model/UninvoicedReportResult.php | 128 +- generated/Model/UninvoicedReportResults.php | 173 +- generated/Model/User.php | 215 +-- generated/Model/UserAssignment.php | 141 +- generated/Model/UserAssignmentProject.php | 74 +- generated/Model/UserAssignmentUser.php | 53 +- generated/Model/UserAssignments.php | 173 +- generated/Model/Users.php | 173 +- generated/Model/UsersPostBody.php | 150 +- .../UsersUserIdBillableRatesPostBody.php | 37 +- .../Model/UsersUserIdCostRatesPostBody.php | 37 +- generated/Model/UsersUserIdPatchBody.php | 150 +- .../Normalizer/BillableRateNormalizer.php | 75 +- .../Normalizer/BillableRatesNormalizer.php | 59 +- generated/Normalizer/ClientNormalizer.php | 85 +- .../ClientsClientIdPatchBodyNormalizer.php | 65 +- generated/Normalizer/ClientsNormalizer.php | 59 +- .../Normalizer/ClientsPostBodyNormalizer.php | 65 +- generated/Normalizer/CompaniesNormalizer.php | 59 +- generated/Normalizer/CompanyNormalizer.php | 145 +- .../Normalizer/CompanyPatchBodyNormalizer.php | 55 +- .../Normalizer/ContactClientNormalizer.php | 55 +- generated/Normalizer/ContactNormalizer.php | 100 +- .../ContactsContactIdPatchBodyNormalizer.php | 85 +- generated/Normalizer/ContactsNormalizer.php | 59 +- .../Normalizer/ContactsPostBodyNormalizer.php | 85 +- generated/Normalizer/CostRateNormalizer.php | 75 +- generated/Normalizer/CostRatesNormalizer.php | 59 +- generated/Normalizer/ErrorNormalizer.php | 45 +- .../Normalizer/EstimateClientNormalizer.php | 55 +- .../Normalizer/EstimateCreatorNormalizer.php | 55 +- ...imateItemCategoryIdPatchBodyNormalizer.php | 50 +- .../EstimateItemCategoriesNormalizer.php | 59 +- ...timateItemCategoriesPostBodyNormalizer.php | 50 +- .../EstimateItemCategoryNormalizer.php | 65 +- .../Normalizer/EstimateLineItemNormalizer.php | 85 +- .../EstimateLineItemsNormalizer.php | 59 +- .../Normalizer/EstimateMessageNormalizer.php | 109 +- .../EstimateMessageRecipientNormalizer.php | 55 +- .../EstimateMessageRecipientsNormalizer.php | 59 +- .../Normalizer/EstimateMessagesNormalizer.php | 59 +- generated/Normalizer/EstimateNormalizer.php | 169 +- ...esEstimateIdMessagesPostBodyNormalizer.php | 74 +- ...ssagesPostBodyRecipientsItemNormalizer.php | 45 +- ...mateIdPatchBodyLineItemsItemNormalizer.php | 45 +- ...EstimatesEstimateIdPatchBodyNormalizer.php | 104 +- generated/Normalizer/EstimatesNormalizer.php | 59 +- ...timatesPostBodyLineItemsItemNormalizer.php | 45 +- .../EstimatesPostBodyNormalizer.php | 104 +- ...esExpenseCategoryIdPatchBodyNormalizer.php | 65 +- .../ExpenseCategoriesNormalizer.php | 59 +- .../ExpenseCategoriesPostBodyNormalizer.php | 65 +- .../Normalizer/ExpenseCategoryNormalizer.php | 80 +- .../Normalizer/ExpenseClientNormalizer.php | 60 +- .../ExpenseExpenseCategoryNormalizer.php | 65 +- .../Normalizer/ExpenseInvoiceNormalizer.php | 55 +- generated/Normalizer/ExpenseNormalizer.php | 135 +- .../Normalizer/ExpenseProjectNormalizer.php | 60 +- .../Normalizer/ExpenseReceiptNormalizer.php | 65 +- .../ExpenseReportsResultNormalizer.php | 105 +- .../ExpenseReportsResultsNormalizer.php | 59 +- .../Normalizer/ExpenseUserNormalizer.php | 55 +- .../ExpensesExpenseIdPatchBodyNormalizer.php | 90 +- generated/Normalizer/ExpensesNormalizer.php | 59 +- .../Normalizer/ExpensesPostBodyNormalizer.php | 90 +- .../Normalizer/InvoiceClientNormalizer.php | 55 +- .../Normalizer/InvoiceCreatorNormalizer.php | 55 +- .../Normalizer/InvoiceEstimateNormalizer.php | 50 +- ...voiceItemCategoryIdPatchBodyNormalizer.php | 50 +- .../InvoiceItemCategoriesNormalizer.php | 59 +- ...nvoiceItemCategoriesPostBodyNormalizer.php | 50 +- .../InvoiceItemCategoryNormalizer.php | 75 +- .../Normalizer/InvoiceLineItemNormalizer.php | 90 +- .../InvoiceLineItemProjectNormalizer.php | 60 +- .../Normalizer/InvoiceLineItemsNormalizer.php | 59 +- .../Normalizer/InvoiceMessageNormalizer.php | 134 +- .../InvoiceMessageRecipientNormalizer.php | 55 +- .../InvoiceMessageRecipientsNormalizer.php | 59 +- .../Normalizer/InvoiceMessagesNormalizer.php | 59 +- generated/Normalizer/InvoiceNormalizer.php | 214 ++- .../Normalizer/InvoicePaymentNormalizer.php | 100 +- ...InvoicePaymentPaymentGatewayNormalizer.php | 55 +- .../Normalizer/InvoicePaymentsNormalizer.php | 59 +- .../Normalizer/InvoiceRetainerNormalizer.php | 50 +- ...cesInvoiceIdMessagesPostBodyNormalizer.php | 89 +- ...ssagesPostBodyRecipientsItemNormalizer.php | 45 +- ...oiceIdPatchBodyLineItemsItemNormalizer.php | 45 +- .../InvoicesInvoiceIdPatchBodyNormalizer.php | 124 +- ...cesInvoiceIdPaymentsPostBodyNormalizer.php | 65 +- generated/Normalizer/InvoicesNormalizer.php | 59 +- ...tBodyLineItemsImportExpensesNormalizer.php | 45 +- ...oicesPostBodyLineItemsImportNormalizer.php | 49 +- ...sPostBodyLineItemsImportTimeNormalizer.php | 45 +- ...nvoicesPostBodyLineItemsItemNormalizer.php | 45 +- .../Normalizer/InvoicesPostBodyNormalizer.php | 129 +- generated/Normalizer/JaneObjectNormalizer.php | 53 +- .../Normalizer/PaginationLinksNormalizer.php | 55 +- .../ProjectAssignmentClientNormalizer.php | 55 +- .../ProjectAssignmentNormalizer.php | 104 +- .../ProjectAssignmentProjectNormalizer.php | 60 +- .../ProjectAssignmentsNormalizer.php | 59 +- .../ProjectBudgetReportResultNormalizer.php | 95 +- .../ProjectBudgetReportResultsNormalizer.php | 59 +- .../Normalizer/ProjectClientNormalizer.php | 60 +- generated/Normalizer/ProjectNormalizer.php | 165 +- generated/Normalizer/ProjectsNormalizer.php | 59 +- .../Normalizer/ProjectsPostBodyNormalizer.php | 145 +- .../ProjectsProjectIdPatchBodyNormalizer.php | 145 +- ...ectIdTaskAssignmentsPostBodyNormalizer.php | 70 +- ...ntsTaskAssignmentIdPatchBodyNormalizer.php | 65 +- ...ectIdUserAssignmentsPostBodyNormalizer.php | 75 +- ...ntsUserAssignmentIdPatchBodyNormalizer.php | 70 +- generated/Normalizer/RoleNormalizer.php | 74 +- generated/Normalizer/RolesNormalizer.php | 59 +- .../Normalizer/RolesPostBodyNormalizer.php | 59 +- .../RolesRoleIdPatchBodyNormalizer.php | 59 +- .../Normalizer/TaskAssignmentNormalizer.php | 90 +- .../TaskAssignmentProjectNormalizer.php | 60 +- .../TaskAssignmentTaskNormalizer.php | 55 +- .../Normalizer/TaskAssignmentsNormalizer.php | 59 +- generated/Normalizer/TaskNormalizer.php | 85 +- generated/Normalizer/TasksNormalizer.php | 59 +- .../Normalizer/TasksPostBodyNormalizer.php | 70 +- .../TasksTaskIdPatchBodyNormalizer.php | 70 +- .../Normalizer/TimeEntriesNormalizer.php | 59 +- ...iesPostBodyExternalReferenceNormalizer.php | 65 +- .../TimeEntriesPostBodyNormalizer.php | 90 +- ...IdPatchBodyExternalReferenceNormalizer.php | 65 +- ...eEntriesTimeEntryIdPatchBodyNormalizer.php | 85 +- .../Normalizer/TimeEntryClientNormalizer.php | 55 +- .../TimeEntryExternalReferenceNormalizer.php | 75 +- .../Normalizer/TimeEntryInvoiceNormalizer.php | 55 +- generated/Normalizer/TimeEntryNormalizer.php | 175 +- .../Normalizer/TimeEntryProjectNormalizer.php | 55 +- .../Normalizer/TimeEntryTaskNormalizer.php | 55 +- .../Normalizer/TimeEntryUserNormalizer.php | 55 +- .../TimeReportsResultNormalizer.php | 110 +- .../TimeReportsResultsNormalizer.php | 59 +- .../UninvoicedReportResultNormalizer.php | 90 +- .../UninvoicedReportResultsNormalizer.php | 59 +- .../Normalizer/UserAssignmentNormalizer.php | 95 +- .../UserAssignmentProjectNormalizer.php | 60 +- .../UserAssignmentUserNormalizer.php | 55 +- .../Normalizer/UserAssignmentsNormalizer.php | 59 +- generated/Normalizer/UserNormalizer.php | 129 +- generated/Normalizer/UsersNormalizer.php | 59 +- .../Normalizer/UsersPostBodyNormalizer.php | 104 +- ...sUserIdBillableRatesPostBodyNormalizer.php | 55 +- ...UsersUserIdCostRatesPostBodyNormalizer.php | 55 +- .../UsersUserIdPatchBodyNormalizer.php | 104 +- generated/Runtime/Client/BaseEndpoint.php | 66 +- generated/Runtime/Client/Client.php | 42 +- .../Runtime/Client/CustomQueryResolver.php | 12 +- generated/Runtime/Client/Endpoint.php | 32 +- generated/Runtime/Client/EndpointTrait.php | 27 +- generated/Runtime/Normalizer/CheckArray.php | 17 +- .../Normalizer/ReferenceNormalizer.php | 16 +- 398 files changed, 17521 insertions(+), 17878 deletions(-) rename .php_cs => .php-cs-fixer.php (72%) diff --git a/.gitignore b/.gitignore index 836c9b7..3012f3f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,9 @@ composer.lock composer.phar # CS -.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit .phpunit.result.cache # Dependencies diff --git a/.php_cs b/.php-cs-fixer.php similarity index 72% rename from .php_cs rename to .php-cs-fixer.php index bf425b4..85935a5 100644 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -9,34 +9,35 @@ file that was distributed with this source code. EOF; -return PhpCsFixer\Config::create() +$finder = (new PhpCsFixer\Finder()) + ->in(__DIR__) + ->exclude('doc') +; + +return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, - 'header_comment' => ['header' => $header], 'array_syntax' => ['syntax' => 'short'], + 'combine_consecutive_unsets' => true, + 'echo_tag_syntax' => ['format' => 'long'], + 'header_comment' => ['header' => $header], + 'heredoc_to_nowdoc' => true, + 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], + 'no_unreachable_default_argument_value' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, 'ordered_class_elements' => true, 'ordered_imports' => true, - 'heredoc_to_nowdoc' => true, - 'php_unit_strict' => true, 'php_unit_construct' => true, + 'php_unit_strict' => true, 'phpdoc_add_missing_param_annotation' => true, 'phpdoc_order' => true, + 'semicolon_after_instruction' => true, 'strict_comparison' => true, 'strict_param' => true, - 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'], - 'no_short_echo_tag' => true, - 'no_unreachable_default_argument_value' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'semicolon_after_instruction' => true, - 'combine_consecutive_unsets' => true, ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__) - ->exclude('generated') - ->exclude('vendor') - ) + ->setUsingCache(true) + ->setFinder($finder) ; diff --git a/composer.json b/composer.json index 18abc9a..4ba5738 100644 --- a/composer.json +++ b/composer.json @@ -22,16 +22,16 @@ } }, "require": { - "php": "^7.2 || ^8.0", - "jane-php/open-api-runtime": "^7.1", + "php": ">=7.4", + "jane-php/open-api-runtime": "^7.3", "php-http/client-implementation": "*", - "php-http/client-common": "^1.7 || ^2.0" + "php-http/client-common": "^1.9 || ^2.0" }, "require-dev": { - "jane-php/open-api-3": "^7.1", + "jane-php/open-api-3": "^7.3", "symfony/http-client": "^5.4 || ^6.0", "nyholm/psr7": "^1.3", - "friendsofphp/php-cs-fixer": "^2.18", + "friendsofphp/php-cs-fixer": "^3.2", "symfony/phpunit-bridge": "^5.4 || ^6.0", "symfony/yaml": "^5.4 || ^6.0" } diff --git a/generated/Authentication/AccountAuthAuthentication.php b/generated/Authentication/AccountAuthAuthentication.php index ae84f10..d333fe0 100644 --- a/generated/Authentication/AccountAuthAuthentication.php +++ b/generated/Authentication/AccountAuthAuthentication.php @@ -1,21 +1,34 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Authentication; class AccountAuthAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin { private $apiKey; + public function __construct(string $apiKey) { $this->{'apiKey'} = $apiKey; } - public function authentication(\Psr\Http\Message\RequestInterface $request) : \Psr\Http\Message\RequestInterface + + public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface { $request = $request->withHeader('Harvest-Account-Id', $this->{'apiKey'}); + return $request; } - public function getScope() : string + + public function getScope(): string { return 'AccountAuth'; } -} \ No newline at end of file +} diff --git a/generated/Authentication/BearerAuthAuthentication.php b/generated/Authentication/BearerAuthAuthentication.php index 25860dc..152ec10 100644 --- a/generated/Authentication/BearerAuthAuthentication.php +++ b/generated/Authentication/BearerAuthAuthentication.php @@ -1,21 +1,34 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Authentication; class BearerAuthAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin { private $apiKey; + public function __construct(string $apiKey) { $this->{'apiKey'} = $apiKey; } - public function authentication(\Psr\Http\Message\RequestInterface $request) : \Psr\Http\Message\RequestInterface + + public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface { $request = $request->withHeader('Authorization', $this->{'apiKey'}); + return $request; } - public function getScope() : string + + public function getScope(): string { return 'BearerAuth'; } -} \ No newline at end of file +} diff --git a/generated/Client.php b/generated/Client.php index b4c5207..7f4ee1f 100644 --- a/generated/Client.php +++ b/generated/Client.php @@ -1,1622 +1,1685 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api; class Client extends \JoliCode\Harvest\Api\Runtime\Client\Client { /** - * Returns a list of your clients. The clients are returned sorted by creation date, with the most recently created clients appearing first. - - The response contains an object with a clients property that contains an array of up to per_page clients. Each entry in the array is a separate client object. If no more clients are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your clients. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Clients|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listClients(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your clients. The clients are returned sorted by creation date, with the most recently created clients appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Clients|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listClients(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListClients($queryParameters), $fetch); } + /** * Creates a new client object. Returns a client object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\ClientsPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ClientsPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createClient(\JoliCode\Harvest\Api\Model\ClientsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createClient(Model\ClientsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateClient($requestBody), $fetch); } + /** * Delete a client. Deleting a client is only possible if it has no projects, invoices, or estimates associated with it. Returns a 200 OK response code if the call succeeded. * - * @param string $clientId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteClient(string $clientId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteClient($clientId), $fetch); } + /** * Retrieves the client with the given ID. Returns a client object and a 200 OK response code if a valid identifier was provided. * - * @param string $clientId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveClient(string $clientId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveClient($clientId), $fetch); } + /** * Updates the specific client by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a client object and a 200 OK response code if the call succeeded. * - * @param string $clientId - * @param \JoliCode\Harvest\Api\Model\ClientsClientIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ClientsClientIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateClient(string $clientId, \JoliCode\Harvest\Api\Model\ClientsClientIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateClient(string $clientId, Model\ClientsClientIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateClient($clientId, $requestBody), $fetch); } + /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveCompany(string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveCompany(), $fetch); } + /** * Updates the company setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a company object and a 200 OK response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\CompanyPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\CompanyPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateCompany(\JoliCode\Harvest\Api\Model\CompanyPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateCompany(Model\CompanyPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateCompany($requestBody), $fetch); } + /** - * Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first. - - The response contains an object with a contacts property that contains an array of up to per_page contacts. Each entry in the array is a separate contact object. If no more contacts are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your contacts. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Contacts|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listContacts(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Contacts|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listContacts(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListContacts($queryParameters), $fetch); } + /** * Creates a new contact object. Returns a contact object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\ContactsPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ContactsPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createContact(\JoliCode\Harvest\Api\Model\ContactsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createContact(Model\ContactsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateContact($requestBody), $fetch); } + /** * Delete a contact. Returns a 200 OK response code if the call succeeded. * - * @param string $contactId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteContact(string $contactId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteContact($contactId), $fetch); } + /** * Retrieves the contact with the given ID. Returns a contact object and a 200 OK response code if a valid identifier was provided. * - * @param string $contactId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveContact(string $contactId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveContact($contactId), $fetch); } + /** * Updates the specific contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a contact object and a 200 OK response code if the call succeeded. * - * @param string $contactId - * @param \JoliCode\Harvest\Api\Model\ContactsContactIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ContactsContactIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateContact(string $contactId, \JoliCode\Harvest\Api\Model\ContactsContactIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateContact(string $contactId, Model\ContactsContactIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateContact($contactId, $requestBody), $fetch); } + /** - * Returns a list of your estimate item categories. The estimate item categories are returned sorted by creation date, with the most recently created estimate item categories appearing first. - - The response contains an object with a estimate_item_categories property that contains an array of up to per_page estimate item categories. Each entry in the array is a separate estimate item category object. If no more estimate item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimate item categories. - * - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategories|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listEstimateItemCategories(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your estimate item categories. The estimate item categories are returned sorted by creation date, with the most recently created estimate item categories appearing first. + + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\EstimateItemCategories|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listEstimateItemCategories(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListEstimateItemCategories($queryParameters), $fetch); } + /** * Creates a new estimate item category object. Returns an estimate item category object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\EstimateItemCategoriesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\EstimateItemCategoriesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createEstimateItemCategory(\JoliCode\Harvest\Api\Model\EstimateItemCategoriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createEstimateItemCategory(Model\EstimateItemCategoriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateEstimateItemCategory($requestBody), $fetch); } + /** * Delete an estimate item category. Returns a 200 OK response code if the call succeeded. * - * @param string $estimateItemCategoryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteEstimateItemCategory(string $estimateItemCategoryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteEstimateItemCategory($estimateItemCategoryId), $fetch); } + /** * Retrieves the estimate item category with the given ID. Returns an estimate item category object and a 200 OK response code if a valid identifier was provided. * - * @param string $estimateItemCategoryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveEstimateItemCategory(string $estimateItemCategoryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveEstimateItemCategory($estimateItemCategoryId), $fetch); } + /** * Updates the specific estimate item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate item category object and a 200 OK response code if the call succeeded. * - * @param string $estimateItemCategoryId - * @param \JoliCode\Harvest\Api\Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateEstimateItemCategory(string $estimateItemCategoryId, \JoliCode\Harvest\Api\Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateEstimateItemCategory(string $estimateItemCategoryId, Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateEstimateItemCategory($estimateItemCategoryId, $requestBody), $fetch); } + /** - * Returns a list of your estimates. The estimates are returned sorted by issue date, with the most recently issued estimates appearing first. - - The response contains an object with a estimates property that contains an array of up to per_page estimates. Each entry in the array is a separate estimate object. If no more estimates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimates. - * - * @param array $queryParameters { - * @var int $client_id Only return estimates belonging to the client with the given ID. - * @var string $updated_since Only return estimates that have been updated since the given date and time. - * @var string $from Only return estimates with an issue_date on or after the given date. - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Estimates|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listEstimates(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your estimates. The estimates are returned sorted by issue date, with the most recently issued estimates appearing first. + + * + * @param array $queryParameters { + * + * @var int $client_id only return estimates belonging to the client with the given ID + * @var string $updated_since only return estimates that have been updated since the given date and time + * @var string $from only return estimates with an issue_date on or after the given date + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Estimates|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listEstimates(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListEstimates($queryParameters), $fetch); } + /** * Creates a new estimate object. Returns an estimate object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\EstimatesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\EstimatesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createEstimate(\JoliCode\Harvest\Api\Model\EstimatesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createEstimate(Model\EstimatesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateEstimate($requestBody), $fetch); } + /** * Delete an estimate. Returns a 200 OK response code if the call succeeded. * - * @param string $estimateId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteEstimate(string $estimateId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteEstimate($estimateId), $fetch); } + /** * Retrieves the estimate with the given ID. Returns an estimate object and a 200 OK response code if a valid identifier was provided. * - * @param string $estimateId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveEstimate(string $estimateId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveEstimate($estimateId), $fetch); } + /** * Updates the specific estimate by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate object and a 200 OK response code if the call succeeded. * - * @param string $estimateId - * @param \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateEstimate(string $estimateId, \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateEstimate(string $estimateId, Model\EstimatesEstimateIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateEstimate($estimateId, $requestBody), $fetch); } + /** - * Returns a list of messages associated with a given estimate. The estimate messages are returned sorted by creation date, with the most recently created messages appearing first. - - The response contains an object with an estimate_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages. - * - * @param string $estimateId - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateMessages|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listMessagesForEstimate(string $estimateId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of messages associated with a given estimate. The estimate messages are returned sorted by creation date, with the most recently created messages appearing first. + + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\EstimateMessages|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listMessagesForEstimate(string $estimateId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListMessagesForEstimate($estimateId, $queryParameters), $fetch); } + /** * Creates a new estimate message object. Returns an estimate message object and a 201 Created response code if the call succeeded. * - * @param string $estimateId - * @param \JoliCode\Harvest\Api\Model\EstimatesEstimateIdMessagesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\EstimatesEstimateIdMessagesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\EstimateMessage|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\EstimateMessage|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createEstimateMessage(string $estimateId, \JoliCode\Harvest\Api\Model\EstimatesEstimateIdMessagesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createEstimateMessage(string $estimateId, Model\EstimatesEstimateIdMessagesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateEstimateMessage($estimateId, $requestBody), $fetch); } + /** * Delete an estimate message. Returns a 200 OK response code if the call succeeded. * - * @param string $estimateId - * @param string $messageId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteEstimateMessage(string $estimateId, string $messageId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteEstimateMessage($estimateId, $messageId), $fetch); } + /** - * Returns a list of your expense categories. The expense categories are returned sorted by creation date, with the most recently created expense categories appearing first. - - The response contains an object with a expense_categories property that contains an array of up to per_page expense categories. Each entry in the array is a separate expense category object. If no more expense categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expense categories. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategories|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listExpenseCategories(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your expense categories. The expense categories are returned sorted by creation date, with the most recently created expense categories appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\ExpenseCategories|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listExpenseCategories(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListExpenseCategories($queryParameters), $fetch); } + /** * Creates a new expense category object. Returns an expense category object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createExpenseCategory(\JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createExpenseCategory(Model\ExpenseCategoriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateExpenseCategory($requestBody), $fetch); } + /** * Delete an expense category. Returns a 200 OK response code if the call succeeded. * - * @param string $expenseCategoryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteExpenseCategory(string $expenseCategoryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteExpenseCategory($expenseCategoryId), $fetch); } + /** * Retrieves the expense category with the given ID. Returns an expense category object and a 200 OK response code if a valid identifier was provided. * - * @param string $expenseCategoryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveExpenseCategory(string $expenseCategoryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveExpenseCategory($expenseCategoryId), $fetch); } + /** * Updates the specific expense category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense category object and a 200 OK response code if the call succeeded. * - * @param string $expenseCategoryId - * @param \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateExpenseCategory(string $expenseCategoryId, \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateExpenseCategory(string $expenseCategoryId, Model\ExpenseCategoriesExpenseCategoryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateExpenseCategory($expenseCategoryId, $requestBody), $fetch); } + /** - * Returns a list of your expenses. If accessing this endpoint as an Administrator, all expenses in the account will be returned. If accessing this endpoint as a Manager, all expenses for assigned teammates and managed projects will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first. - - The response contains an object with a expenses property that contains an array of up to per_page expenses. Each entry in the array is a separate expense object. If no more expenses are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expenses. - * - * @param array $queryParameters { - * @var int $user_id Only return expenses belonging to the user with the given ID. - * @var int $client_id Only return expenses belonging to the client with the given ID. - * @var int $project_id Only return expenses belonging to the project with the given ID. - * @var bool $is_billed Pass true to only return expenses that have been invoiced and false to return expenses that have not been invoiced. - * @var string $updated_since Only return expenses that have been updated since the given date and time. - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Expenses|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listExpenses(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your expenses. If accessing this endpoint as an Administrator, all expenses in the account will be returned. If accessing this endpoint as a Manager, all expenses for assigned teammates and managed projects will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first. + + * + * @param array $queryParameters { + * + * @var int $user_id only return expenses belonging to the user with the given ID + * @var int $client_id only return expenses belonging to the client with the given ID + * @var int $project_id only return expenses belonging to the project with the given ID + * @var bool $is_billed pass true to only return expenses that have been invoiced and false to return expenses that have not been invoiced + * @var string $updated_since only return expenses that have been updated since the given date and time + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Expenses|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listExpenses(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListExpenses($queryParameters), $fetch); } + /** * Creates a new expense object. Returns an expense object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\ExpensesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ExpensesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createExpense(\JoliCode\Harvest\Api\Model\ExpensesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createExpense(Model\ExpensesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateExpense($requestBody), $fetch); } + /** * Delete an expense. Returns a 200 OK response code if the call succeeded. * - * @param string $expenseId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteExpense(string $expenseId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteExpense($expenseId), $fetch); } + /** * Retrieves the expense with the given ID. Returns an expense object and a 200 OK response code if a valid identifier was provided. * - * @param string $expenseId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveExpense(string $expenseId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveExpense($expenseId), $fetch); } + /** * Updates the specific expense by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense object and a 200 OK response code if the call succeeded. * - * @param string $expenseId - * @param \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateExpense(string $expenseId, \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateExpense(string $expenseId, Model\ExpensesExpenseIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateExpense($expenseId, $requestBody), $fetch); } + /** - * Returns a list of your invoice item categories. The invoice item categories are returned sorted by creation date, with the most recently created invoice item categories appearing first. - - The response contains an object with a invoice_item_categories property that contains an array of up to per_page invoice item categories. Each entry in the array is a separate invoice item category object. If no more invoice item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoice item categories. - * - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategories|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listInvoiceItemCategories(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your invoice item categories. The invoice item categories are returned sorted by creation date, with the most recently created invoice item categories appearing first. + + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategories|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listInvoiceItemCategories(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListInvoiceItemCategories($queryParameters), $fetch); } + /** * Creates a new invoice item category object. Returns an invoice item category object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createInvoiceItemCategory(\JoliCode\Harvest\Api\Model\InvoiceItemCategoriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createInvoiceItemCategory(Model\InvoiceItemCategoriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateInvoiceItemCategory($requestBody), $fetch); } + /** * Delete an invoice item category. Deleting an invoice item category is only possible if use_as_service and use_as_expense are both false. Returns a 200 OK response code if the call succeeded. * - * @param string $invoiceItemCategoryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteInvoiceItemCategory(string $invoiceItemCategoryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteInvoiceItemCategory($invoiceItemCategoryId), $fetch); } + /** * Retrieves the invoice item category with the given ID. Returns an invoice item category object and a 200 OK response code if a valid identifier was provided. * - * @param string $invoiceItemCategoryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveInvoiceItemCategory(string $invoiceItemCategoryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveInvoiceItemCategory($invoiceItemCategoryId), $fetch); } + /** * Updates the specific invoice item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice item category object and a 200 OK response code if the call succeeded. * - * @param string $invoiceItemCategoryId - * @param \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateInvoiceItemCategory(string $invoiceItemCategoryId, \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateInvoiceItemCategory(string $invoiceItemCategoryId, Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateInvoiceItemCategory($invoiceItemCategoryId, $requestBody), $fetch); } + /** - * Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first. - - The response contains an object with a invoices property that contains an array of up to per_page invoices. Each entry in the array is a separate invoice object. If no more invoices are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoices. - * - * @param array $queryParameters { - * @var int $client_id Only return invoices belonging to the client with the given ID. - * @var int $project_id Only return invoices associated with the project with the given ID. - * @var string $updated_since Only return invoices that have been updated since the given date and time. - * @var string $from Only return invoices with an issue_date on or after the given date. - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Invoices|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listInvoices(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first. + + * + * @param array $queryParameters { + * + * @var int $client_id only return invoices belonging to the client with the given ID + * @var int $project_id only return invoices associated with the project with the given ID + * @var string $updated_since only return invoices that have been updated since the given date and time + * @var string $from only return invoices with an issue_date on or after the given date + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Invoices|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listInvoices(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListInvoices($queryParameters), $fetch); } + /** * Creates a new invoice object. Returns an invoice object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\InvoicesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\InvoicesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createInvoice(\JoliCode\Harvest\Api\Model\InvoicesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createInvoice(Model\InvoicesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateInvoice($requestBody), $fetch); } + /** * Delete an invoice. Returns a 200 OK response code if the call succeeded. * - * @param string $invoiceId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteInvoice(string $invoiceId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteInvoice($invoiceId), $fetch); } + /** * Retrieves the invoice with the given ID. Returns an invoice object and a 200 OK response code if a valid identifier was provided. * - * @param string $invoiceId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveInvoice(string $invoiceId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveInvoice($invoiceId), $fetch); } + /** * Updates the specific invoice by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice object and a 200 OK response code if the call succeeded. * - * @param string $invoiceId - * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateInvoice(string $invoiceId, \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateInvoice(string $invoiceId, Model\InvoicesInvoiceIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateInvoice($invoiceId, $requestBody), $fetch); } + /** - * Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first. - - The response contains an object with an invoice_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages. - * - * @param string $invoiceId - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceMessages|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listMessagesForInvoice(string $invoiceId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first. + + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\InvoiceMessages|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listMessagesForInvoice(string $invoiceId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListMessagesForInvoice($invoiceId, $queryParameters), $fetch); } + /** * Creates a new invoice message object. Returns an invoice message object and a 201 Created response code if the call succeeded. * - * @param string $invoiceId - * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdMessagesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdMessagesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceMessage|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\InvoiceMessage|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createInvoiceMessage(string $invoiceId, \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdMessagesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createInvoiceMessage(string $invoiceId, Model\InvoicesInvoiceIdMessagesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateInvoiceMessage($invoiceId, $requestBody), $fetch); } + /** * Delete an invoice message. Returns a 200 OK response code if the call succeeded. * - * @param string $invoiceId - * @param string $messageId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteInvoiceMessage(string $invoiceId, string $messageId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteInvoiceMessage($invoiceId, $messageId), $fetch); } + /** - * Returns a list of payments associate with a given invoice. The payments are returned sorted by creation date, with the most recently created payments appearing first. - - The response contains an object with an invoice_payments property that contains an array of up to per_page payments. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your payments. - * - * @param string $invoiceId - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\InvoicePayments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listPaymentsForInvoice(string $invoiceId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of payments associate with a given invoice. The payments are returned sorted by creation date, with the most recently created payments appearing first. + + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\InvoicePayments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listPaymentsForInvoice(string $invoiceId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListPaymentsForInvoice($invoiceId, $queryParameters), $fetch); } + /** * Creates a new invoice payment object. Returns an invoice payment object and a 201 Created response code if the call succeeded. * - * @param string $invoiceId - * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\InvoicePayment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\InvoicePayment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createInvoicePayment(string $invoiceId, \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createInvoicePayment(string $invoiceId, Model\InvoicesInvoiceIdPaymentsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateInvoicePayment($invoiceId, $requestBody), $fetch); } + /** * Delete an invoice payment. Returns a 200 OK response code if the call succeeded. * - * @param string $invoiceId - * @param string $paymentId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteInvoicePayment(string $invoiceId, string $paymentId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteInvoicePayment($invoiceId, $paymentId), $fetch); } + /** - * Returns a list of your projects. The projects are returned sorted by creation date, with the most recently created projects appearing first. - - The response contains an object with a projects property that contains an array of up to per_page projects. Each entry in the array is a separate project object. If no more projects are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your projects. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Projects|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listProjects(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your projects. The projects are returned sorted by creation date, with the most recently created projects appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Projects|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listProjects(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListProjects($queryParameters), $fetch); } + /** * Creates a new project object. Returns a project object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\ProjectsPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ProjectsPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createProject(\JoliCode\Harvest\Api\Model\ProjectsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createProject(Model\ProjectsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateProject($requestBody), $fetch); } + /** - * Deletes a project and any time entries or expenses tracked to it. - However, invoices associated with the project will not be deleted. - If you don’t want the project’s time entries and expenses to be deleted, you should archive the project instead. - * - * @param string $projectId - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ + * Deletes a project and any time entries or expenses tracked to it. + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ public function deleteProject(string $projectId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteProject($projectId), $fetch); } + /** * Retrieves the project with the given ID. Returns a project object and a 200 OK response code if a valid identifier was provided. * - * @param string $projectId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveProject(string $projectId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveProject($projectId), $fetch); } + /** * Updates the specific project by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a project object and a 200 OK response code if the call succeeded. * - * @param string $projectId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateProject(string $projectId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateProject(string $projectId, Model\ProjectsProjectIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateProject($projectId, $requestBody), $fetch); } + /** - * Returns a list of your task assignments for the project identified by PROJECT_ID. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. - - The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments. - * - * @param string $projectId - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listTaskAssignmentsForSpecificProject(string $projectId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your task assignments for the project identified by PROJECT_ID. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listTaskAssignmentsForSpecificProject(string $projectId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListTaskAssignmentsForSpecificProject($projectId, $queryParameters), $fetch); } + /** * Creates a new task assignment object. Returns a task assignment object and a 201 Created response code if the call succeeded. * - * @param string $projectId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createTaskAssignment(string $projectId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createTaskAssignment(string $projectId, Model\ProjectsProjectIdTaskAssignmentsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateTaskAssignment($projectId, $requestBody), $fetch); } + /** * Delete a task assignment. Deleting a task assignment is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded. * - * @param string $projectId - * @param string $taskAssignmentId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteTaskAssignment(string $projectId, string $taskAssignmentId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteTaskAssignment($projectId, $taskAssignmentId), $fetch); } + /** * Retrieves the task assignment with the given ID. Returns a task assignment object and a 200 OK response code if a valid identifier was provided. * - * @param string $projectId - * @param string $taskAssignmentId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveTaskAssignment(string $projectId, string $taskAssignmentId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveTaskAssignment($projectId, $taskAssignmentId), $fetch); } + /** * Updates the specific task assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task assignment object and a 200 OK response code if the call succeeded. * - * @param string $projectId - * @param string $taskAssignmentId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateTaskAssignment(string $projectId, string $taskAssignmentId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateTaskAssignment(string $projectId, string $taskAssignmentId, Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateTaskAssignment($projectId, $taskAssignmentId, $requestBody), $fetch); } + /** - * Returns a list of user assignments for the project identified by PROJECT_ID. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. - - The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments. - * - * @param string $projectId - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listUserAssignmentsForSpecificProject(string $projectId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of user assignments for the project identified by PROJECT_ID. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listUserAssignmentsForSpecificProject(string $projectId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListUserAssignmentsForSpecificProject($projectId, $queryParameters), $fetch); } + /** * Creates a new user assignment object. Returns a user assignment object and a 201 Created response code if the call succeeded. * - * @param string $projectId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createUserAssignment(string $projectId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createUserAssignment(string $projectId, Model\ProjectsProjectIdUserAssignmentsPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateUserAssignment($projectId, $requestBody), $fetch); } + /** * Delete a user assignment. Deleting a user assignment is only possible if it has no time entries or expenses associated with it. Returns a 200 OK response code if the call succeeded. * - * @param string $projectId - * @param string $userAssignmentId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteUserAssignment(string $projectId, string $userAssignmentId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteUserAssignment($projectId, $userAssignmentId), $fetch); } + /** * Retrieves the user assignment with the given ID. Returns a user assignment object and a 200 OK response code if a valid identifier was provided. * - * @param string $projectId - * @param string $userAssignmentId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveUserAssignment(string $projectId, string $userAssignmentId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveUserAssignment($projectId, $userAssignmentId), $fetch); } + /** * Updates the specific user assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user assignment object and a 200 OK response code if the call succeeded. * - * @param string $projectId - * @param string $userAssignmentId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateUserAssignment(string $projectId, string $userAssignmentId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateUserAssignment(string $projectId, string $userAssignmentId, Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateUserAssignment($projectId, $userAssignmentId, $requestBody), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function expenseCategoriesReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function expenseCategoriesReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ExpenseCategoriesReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function clientsExpensesReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function clientsExpensesReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ClientsExpensesReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function projectsExpensesReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function projectsExpensesReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ProjectsExpensesReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function teamExpensesReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function teamExpensesReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\TeamExpensesReport($queryParameters), $fetch); } + /** * The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results. * * @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 1000. (Default: 1000) * @var bool $is_active Pass true to only return active projects and false to return inactive projects. * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\ProjectBudgetReportResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\ProjectBudgetReportResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function projectBudgetReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function projectBudgetReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ProjectBudgetReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function clientsTimeReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function clientsTimeReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ClientsTimeReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function projectsTimeReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function projectsTimeReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ProjectsTimeReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function tasksReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function tasksReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\TasksReport($queryParameters), $fetch); } + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } + * * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function teamTimeReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + public function teamTimeReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\TeamTimeReport($queryParameters), $fetch); } + /** - * The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results. - - Note: Each request requires both the from and to parameters to be supplied in the URL’s query string. The timeframe supplied cannot exceed 1 year (365 days). - * - * @param array $queryParameters { - * @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 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 1000. (Default: 1000) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\UninvoicedReportResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function uninvoicedReport(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results. + + * + * @param array $queryParameters { + * + * @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 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 1000. (Default: 1000) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\UninvoicedReportResults|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function uninvoicedReport(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UninvoicedReport($queryParameters), $fetch); } + /** - * Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first. - - The response contains an object with a roles property that contains an array of up to per_page roles. Each entry in the array is a separate role object. If no more roles are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your roles. - * - * @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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Roles|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listRoles(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first. + + * + * @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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Roles|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listRoles(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListRoles($queryParameters), $fetch); } + /** * Creates a new role object. Returns a role object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\RolesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\RolesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createRole(\JoliCode\Harvest\Api\Model\RolesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createRole(Model\RolesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateRole($requestBody), $fetch); } + /** * Delete a role. Deleting a role will unlink it from any users it was assigned to. Returns a 200 OK response code if the call succeeded. * - * @param string $roleId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteRole(string $roleId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteRole($roleId), $fetch); } + /** * Retrieves the role with the given ID. Returns a role object and a 200 OK response code if a valid identifier was provided. * - * @param string $roleId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveRole(string $roleId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveRole($roleId), $fetch); } + /** * Updates the specific role by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a role object and a 200 OK response code if the call succeeded. * - * @param string $roleId - * @param \JoliCode\Harvest\Api\Model\RolesRoleIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\RolesRoleIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateRole(string $roleId, \JoliCode\Harvest\Api\Model\RolesRoleIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateRole(string $roleId, Model\RolesRoleIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateRole($roleId, $requestBody), $fetch); } + /** - * Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. - - The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listTaskAssignments(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listTaskAssignments(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListTaskAssignments($queryParameters), $fetch); } + /** - * Returns a list of your tasks. The tasks are returned sorted by creation date, with the most recently created tasks appearing first. - - The response contains an object with a tasks property that contains an array of up to per_page tasks. Each entry in the array is a separate task object. If no more tasks are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your tasks. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Tasks|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listTasks(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your tasks. The tasks are returned sorted by creation date, with the most recently created tasks appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Tasks|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listTasks(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListTasks($queryParameters), $fetch); } + /** * Creates a new task object. Returns a task object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\TasksPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\TasksPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createTask(\JoliCode\Harvest\Api\Model\TasksPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createTask(Model\TasksPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateTask($requestBody), $fetch); } + /** * Delete a task. Deleting a task is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded. * - * @param string $taskId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteTask(string $taskId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteTask($taskId), $fetch); } + /** * Retrieves the task with the given ID. Returns a task object and a 200 OK response code if a valid identifier was provided. * - * @param string $taskId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveTask(string $taskId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveTask($taskId), $fetch); } + /** * Updates the specific task by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task object and a 200 OK response code if the call succeeded. * - * @param string $taskId - * @param \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateTask(string $taskId, \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateTask(string $taskId, Model\TasksTaskIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateTask($taskId, $requestBody), $fetch); } + /** - * Returns a list of time entries. The time entries are returned sorted by spent_date date. At this time, the sort option can’t be customized. - - The response contains an object with a time_entries property that contains an array of up to per_page time entries. Each entry in the array is a separate time entry object. If no more time entries are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your time entries. - * - * @param array $queryParameters { - * @var int $user_id Only return time entries belonging to the user with the given ID. - * @var int $client_id Only return time entries belonging to the client with the given ID. - * @var int $project_id Only return time entries belonging to the project with the given ID. - * @var int $task_id Only return time entries belonging to the task with the given ID. - * @var string $external_reference_id Only return time entries with the given external_reference ID. - * @var bool $is_billed Pass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced. - * @var bool $is_running Pass true to only return running time entries and false to return non-running time entries. - * @var string $updated_since Only return time entries that have been updated since the given date and time. Use the ISO 8601 Format. - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntries|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listTimeEntries(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of time entries. The time entries are returned sorted by spent_date date. At this time, the sort option can’t be customized. + + * + * @param array $queryParameters { + * + * @var int $user_id only return time entries belonging to the user with the given ID + * @var int $client_id only return time entries belonging to the client with the given ID + * @var int $project_id only return time entries belonging to the project with the given ID + * @var int $task_id only return time entries belonging to the task with the given ID + * @var string $external_reference_id only return time entries with the given external_reference ID + * @var bool $is_billed pass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced + * @var bool $is_running pass true to only return running time entries and false to return non-running time entries + * @var string $updated_since Only return time entries that have been updated since the given date and time. Use the ISO 8601 Format. + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\TimeEntries|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listTimeEntries(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListTimeEntries($queryParameters), $fetch); } + /** - * Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded. - - You should only use this method to create time entries when your account is configured to track time via duration. You can verify this by visiting the Settings page in your Harvest account or by checking if wants_timestamp_timers is false in the Company API. - * - * @param \JoliCode\Harvest\Api\Model\TimeEntriesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function createTimeEntry(\JoliCode\Harvest\Api\Model\TimeEntriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + * Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded. + + * + * @param \JoliCode\Harvest\Api\Model\TimeEntriesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function createTimeEntry(Model\TimeEntriesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateTimeEntry($requestBody), $fetch); } + /** * Delete a time entry. Deleting a time entry is only possible if it’s not closed and the associated project and task haven’t been archived. However, Admins can delete closed entries. Returns a 200 OK response code if the call succeeded. * - * @param string $timeEntryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteTimeEntry(string $timeEntryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteTimeEntry($timeEntryId), $fetch); } + /** * Retrieves the time entry with the given ID. Returns a time entry object and a 200 OK response code if a valid identifier was provided. * - * @param string $timeEntryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveTimeEntry(string $timeEntryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveTimeEntry($timeEntryId), $fetch); } + /** * Updates the specific time entry by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a time entry object and a 200 OK response code if the call succeeded. * - * @param string $timeEntryId - * @param \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateTimeEntry(string $timeEntryId, \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateTimeEntry(string $timeEntryId, Model\TimeEntriesTimeEntryIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateTimeEntry($timeEntryId, $requestBody), $fetch); } + /** * Delete a time entry’s external reference. Returns a 200 OK response code if the call succeeded. * - * @param string $timeEntryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteTimeEntryExternalReference(string $timeEntryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteTimeEntryExternalReference($timeEntryId), $fetch); } + /** * Restarting a time entry is only possible if it isn’t currently running. Returns a 200 OK response code if the call succeeded. * - * @param string $timeEntryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function restartStoppedTimeEntry(string $timeEntryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RestartStoppedTimeEntry($timeEntryId), $fetch); } + /** * Stopping a time entry is only possible if it’s currently running. Returns a 200 OK response code if the call succeeded. * - * @param string $timeEntryId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function stopRunningTimeEntry(string $timeEntryId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\StopRunningTimeEntry($timeEntryId), $fetch); } + /** - * Returns a list of your projects user assignments, active and archived. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. - - The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listUserAssignments(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your projects user assignments, active and archived. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listUserAssignments(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListUserAssignments($queryParameters), $fetch); } + /** - * Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first. - - The response contains an object with a users property that contains an array of up to per_page users. Each entry in the array is a separate user object. If no more users are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your users. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\Users|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listUsers(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\Users|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listUsers(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListUsers($queryParameters), $fetch); } + /** * Creates a new user object and sends an invitation email to the address specified in the email parameter. Returns a user object and a 201 Created response code if the call succeeded. * - * @param \JoliCode\Harvest\Api\Model\UsersPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\UsersPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function createUser(\JoliCode\Harvest\Api\Model\UsersPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function createUser(Model\UsersPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateUser($requestBody), $fetch); } + /** * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveTheCurrentlyAuthenticatedUser(string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveTheCurrentlyAuthenticatedUser(), $fetch); } + /** - * Returns a list of your active project assignments for the currently authenticated user. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. - - The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments. - * - * @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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser(array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of your active project assignments for the currently authenticated user. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. + + * + * @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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser(array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser($queryParameters), $fetch); } + /** * Delete a user. Deleting a user is only possible if they have no time entries or expenses associated with them. Returns a 200 OK response code if the call succeeded. * - * @param string $userId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function deleteUser(string $userId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\DeleteUser($userId), $fetch); } + /** * Retrieves the user with the given ID. Returns a user object and a 200 OK response code if a valid identifier was provided. * - * @param string $userId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveUser(string $userId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveUser($userId), $fetch); } + /** * Updates the specific user by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user object and a 200 OK response code if the call succeeded. * - * @param string $userId - * @param \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * @param \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ - public function updateUser(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) + public function updateUser(string $userId, Model\UsersUserIdPatchBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\UpdateUser($userId, $requestBody), $fetch); } + /** - * Returns a list of billable rates for the user identified by USER_ID. The billable rates are returned sorted by start_date, with the oldest starting billable rates appearing first. - - The response contains an object with a billable_rates property that contains an array of up to per_page billable rates. Each entry in the array is a separate billable rate object. If no more billable rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your billable rates. - * - * @param string $userId - * @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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\BillableRates|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listBillableRatesForSpecificUser(string $userId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of billable rates for the user identified by USER_ID. The billable rates are returned sorted by start_date, with the oldest starting billable rates appearing first. + + * + * @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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\BillableRates|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listBillableRatesForSpecificUser(string $userId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListBillableRatesForSpecificUser($userId, $queryParameters), $fetch); } + /** - * Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded. - - - Creating a billable rate with no start_date will replace a user’s existing rate(s). - Creating a billable rate with a start_date that is before a user’s existing rate(s) will replace those billable rates with the new one. - - * - * @param string $userId - * @param \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function createBillableRate(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + * Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded. + + + * + * @param \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function createBillableRate(string $userId, Model\UsersUserIdBillableRatesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateBillableRate($userId, $requestBody), $fetch); } + /** * Retrieves the billable rate with the given ID. Returns a billable rate object and a 200 OK response code if a valid identifier was provided. * - * @param string $userId - * @param string $billableRateId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveBillableRate(string $userId, string $billableRateId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveBillableRate($userId, $billableRateId), $fetch); } + /** - * Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first. - - The response contains an object with a cost_rates property that contains an array of up to per_page cost rates. Each entry in the array is a separate cost rate object. If no more cost rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your cost rates. - * - * @param string $userId - * @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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\CostRates|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listCostRatesForSpecificUser(string $userId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first. + + * + * @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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\CostRates|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listCostRatesForSpecificUser(string $userId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListCostRatesForSpecificUser($userId, $queryParameters), $fetch); } + /** - * Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded. - - - Creating a cost rate with no start_date will replace a user’s existing rate(s). - Creating a cost rate with a start_date that is before a user’s existing rate(s) will replace those cost rates with the new one. - - * - * @param string $userId - * @param \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $requestBody - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function createCostRate(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) + * Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded. + + + * + * @param \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $requestBody + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function createCostRate(string $userId, Model\UsersUserIdCostRatesPostBody $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\CreateCostRate($userId, $requestBody), $fetch); } + /** * Retrieves the cost rate with the given ID. Returns a cost rate object and a 200 OK response code if a valid identifier was provided. * - * @param string $userId - * @param string $costRateId * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) * - * @return null|\JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface + * @return \JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null */ public function retrieveCostRate(string $userId, string $costRateId, string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\RetrieveCostRate($userId, $costRateId), $fetch); } + /** - * Returns a list of active project assignments for the user identified by USER_ID. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. - - The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments. - * - * @param string $userId - * @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 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 100. (Default: 100) - * } - * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) - * - * @return null|\JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface - */ - public function listActiveProjectAssignments(string $userId, array $queryParameters = array(), string $fetch = self::FETCH_OBJECT) + * Returns a list of active project assignments for the user identified by USER_ID. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. + + * + * @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 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 100. (Default: 100) + * } + * + * @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE) + * + * @return \JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error|\Psr\Http\Message\ResponseInterface|null + */ + public function listActiveProjectAssignments(string $userId, array $queryParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new \JoliCode\Harvest\Api\Endpoint\ListActiveProjectAssignments($userId, $queryParameters), $fetch); } - public static function create($httpClient = null, array $additionalPlugins = array()) + + public static function create($httpClient = null, array $additionalPlugins = [], array $additionalNormalizers = []) { if (null === $httpClient) { $httpClient = \Http\Discovery\Psr18ClientDiscovery::find(); - $plugins = array(); + $plugins = []; $uri = \Http\Discovery\Psr17FactoryDiscovery::findUrlFactory()->createUri('https://api.harvestapp.com/v2'); $plugins[] = new \Http\Client\Common\Plugin\AddHostPlugin($uri); $plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri); - if (count($additionalPlugins) > 0) { + if (\count($additionalPlugins) > 0) { $plugins = array_merge($plugins, $additionalPlugins); } $httpClient = new \Http\Client\Common\PluginClient($httpClient, $plugins); } $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); $streamFactory = \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(); - $serializer = new \Symfony\Component\Serializer\Serializer(array(new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new \JoliCode\Harvest\Api\Normalizer\JaneObjectNormalizer()), array(new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(array('json_decode_associative' => true))))); + $normalizers = [new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), new \JoliCode\Harvest\Api\Normalizer\JaneObjectNormalizer()]; + if (\count($additionalNormalizers) > 0) { + $normalizers = array_merge($normalizers, $additionalNormalizers); + } + $serializer = new \Symfony\Component\Serializer\Serializer($normalizers, [new \Symfony\Component\Serializer\Encoder\JsonEncoder(new \Symfony\Component\Serializer\Encoder\JsonEncode(), new \Symfony\Component\Serializer\Encoder\JsonDecode(['json_decode_associative' => true]))]); + return new static($httpClient, $requestFactory, $serializer, $streamFactory); } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ClientsExpensesReport.php b/generated/Endpoint/ClientsExpensesReport.php index 1cf84ab..7fc4a74 100644 --- a/generated/Endpoint/ClientsExpensesReport.php +++ b/generated/Endpoint/ClientsExpensesReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ClientsExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/expenses/clients'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ClientsTimeReport.php b/generated/Endpoint/ClientsTimeReport.php index 87d3a32..1c8f083 100644 --- a/generated/Endpoint/ClientsTimeReport.php +++ b/generated/Endpoint/ClientsTimeReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ClientsTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/time/clients'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateBillableRate.php b/generated/Endpoint/CreateBillableRate.php index e5ec6b1..767d828 100644 --- a/generated/Endpoint/CreateBillableRate.php +++ b/generated/Endpoint/CreateBillableRate.php @@ -1,63 +1,74 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateBillableRate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** - * Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded. - - - Creating a billable rate with no start_date will replace a user’s existing rate(s). + * Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded. + + Creating a billable rate with a start_date that is before a user’s existing rate(s) will replace those billable rates with the new one. - - * - * @param string $userId - * @param \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $requestBody - */ + */ public function __construct(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody $requestBody) { $this->userId = $userId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/billable_rates'); + return str_replace(['{userId}'], [$this->userId], '/users/{userId}/billable_rates'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\UsersUserIdBillableRatesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateClient.php b/generated/Endpoint/CreateClient.php index 427946c..387df68 100644 --- a/generated/Endpoint/CreateClient.php +++ b/generated/Endpoint/CreateClient.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateClient extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new client object. Returns a client object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\ClientsPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\ClientsPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/clients'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ClientsPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateContact.php b/generated/Endpoint/CreateContact.php index 9ffa792..c668f7b 100644 --- a/generated/Endpoint/CreateContact.php +++ b/generated/Endpoint/CreateContact.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateContact extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new contact object. Returns a contact object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\ContactsPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\ContactsPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/contacts'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ContactsPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateCostRate.php b/generated/Endpoint/CreateCostRate.php index 4a49d30..453df79 100644 --- a/generated/Endpoint/CreateCostRate.php +++ b/generated/Endpoint/CreateCostRate.php @@ -1,63 +1,74 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateCostRate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** - * Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded. - - - Creating a cost rate with no start_date will replace a user’s existing rate(s). + * Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded. + + Creating a cost rate with a start_date that is before a user’s existing rate(s) will replace those cost rates with the new one. - - * - * @param string $userId - * @param \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $requestBody - */ + */ public function __construct(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody $requestBody) { $this->userId = $userId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/cost_rates'); + return str_replace(['{userId}'], [$this->userId], '/users/{userId}/cost_rates'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\UsersUserIdCostRatesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateEstimate.php b/generated/Endpoint/CreateEstimate.php index 7b1d907..b4ec151 100644 --- a/generated/Endpoint/CreateEstimate.php +++ b/generated/Endpoint/CreateEstimate.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new estimate object. Returns an estimate object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\EstimatesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\EstimatesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/estimates'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\EstimatesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateEstimateItemCategory.php b/generated/Endpoint/CreateEstimateItemCategory.php index e7cfc25..b93067b 100644 --- a/generated/Endpoint/CreateEstimateItemCategory.php +++ b/generated/Endpoint/CreateEstimateItemCategory.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateEstimateItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new estimate item category object. Returns an estimate item category object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\EstimateItemCategoriesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\EstimateItemCategoriesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/estimate_item_categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\EstimateItemCategoriesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateEstimateMessage.php b/generated/Endpoint/CreateEstimateMessage.php index a3f4cc9..bdf781e 100644 --- a/generated/Endpoint/CreateEstimateMessage.php +++ b/generated/Endpoint/CreateEstimateMessage.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateEstimateMessage extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateId; + /** * Creates a new estimate message object. Returns an estimate message object and a 201 Created response code if the call succeeded. - * - * @param string $estimateId - * @param \JoliCode\Harvest\Api\Model\EstimatesEstimateIdMessagesPostBody $requestBody */ public function __construct(string $estimateId, \JoliCode\Harvest\Api\Model\EstimatesEstimateIdMessagesPostBody $requestBody) { $this->estimateId = $estimateId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{estimateId}'), array($this->estimateId), '/estimates/{estimateId}/messages'); + return str_replace(['{estimateId}'], [$this->estimateId], '/estimates/{estimateId}/messages'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\EstimatesEstimateIdMessagesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateMessage|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateExpense.php b/generated/Endpoint/CreateExpense.php index 0628dc8..6d6d55d 100644 --- a/generated/Endpoint/CreateExpense.php +++ b/generated/Endpoint/CreateExpense.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateExpense extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new expense object. Returns an expense object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\ExpensesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\ExpensesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/expenses'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ExpensesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateExpenseCategory.php b/generated/Endpoint/CreateExpenseCategory.php index e42801b..6f04cb2 100644 --- a/generated/Endpoint/CreateExpenseCategory.php +++ b/generated/Endpoint/CreateExpenseCategory.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateExpenseCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new expense category object. Returns an expense category object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/expense_categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ExpenseCategoriesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateInvoice.php b/generated/Endpoint/CreateInvoice.php index 8cc6545..425ffe6 100644 --- a/generated/Endpoint/CreateInvoice.php +++ b/generated/Endpoint/CreateInvoice.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new invoice object. Returns an invoice object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\InvoicesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\InvoicesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/invoices'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\InvoicesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateInvoiceItemCategory.php b/generated/Endpoint/CreateInvoiceItemCategory.php index 100e5c8..94d0958 100644 --- a/generated/Endpoint/CreateInvoiceItemCategory.php +++ b/generated/Endpoint/CreateInvoiceItemCategory.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateInvoiceItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new invoice item category object. Returns an invoice item category object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\InvoiceItemCategoriesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/invoice_item_categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateInvoiceMessage.php b/generated/Endpoint/CreateInvoiceMessage.php index 8beb379..e9f54d3 100644 --- a/generated/Endpoint/CreateInvoiceMessage.php +++ b/generated/Endpoint/CreateInvoiceMessage.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateInvoiceMessage extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** * Creates a new invoice message object. Returns an invoice message object and a 201 Created response code if the call succeeded. - * - * @param string $invoiceId - * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdMessagesPostBody $requestBody */ public function __construct(string $invoiceId, \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdMessagesPostBody $requestBody) { $this->invoiceId = $invoiceId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}/messages'); + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}/messages'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdMessagesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceMessage|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateInvoicePayment.php b/generated/Endpoint/CreateInvoicePayment.php index 08a5470..1efb950 100644 --- a/generated/Endpoint/CreateInvoicePayment.php +++ b/generated/Endpoint/CreateInvoicePayment.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateInvoicePayment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** * Creates a new invoice payment object. Returns an invoice payment object and a 201 Created response code if the call succeeded. - * - * @param string $invoiceId - * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody $requestBody */ public function __construct(string $invoiceId, \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody $requestBody) { $this->invoiceId = $invoiceId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}/payments'); + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}/payments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPaymentsPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoicePayment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateProject.php b/generated/Endpoint/CreateProject.php index fd41145..bff939e 100644 --- a/generated/Endpoint/CreateProject.php +++ b/generated/Endpoint/CreateProject.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateProject extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new project object. Returns a project object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\ProjectsPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\ProjectsPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/projects'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ProjectsPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateRole.php b/generated/Endpoint/CreateRole.php index ec857a9..a768745 100644 --- a/generated/Endpoint/CreateRole.php +++ b/generated/Endpoint/CreateRole.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateRole extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new role object. Returns a role object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\RolesPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\RolesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/roles'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\RolesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateTask.php b/generated/Endpoint/CreateTask.php index 56b19d9..9c2ab89 100644 --- a/generated/Endpoint/CreateTask.php +++ b/generated/Endpoint/CreateTask.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateTask extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new task object. Returns a task object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\TasksPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\TasksPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/tasks'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\TasksPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateTaskAssignment.php b/generated/Endpoint/CreateTaskAssignment.php index d2a5d11..979e988 100644 --- a/generated/Endpoint/CreateTaskAssignment.php +++ b/generated/Endpoint/CreateTaskAssignment.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateTaskAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** * Creates a new task assignment object. Returns a task assignment object and a 201 Created response code if the call succeeded. - * - * @param string $projectId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody $requestBody */ public function __construct(string $projectId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody $requestBody) { $this->projectId = $projectId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}/task_assignments'); + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}/task_assignments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateTimeEntry.php b/generated/Endpoint/CreateTimeEntry.php index 08fee04..1c0ae8f 100644 --- a/generated/Endpoint/CreateTimeEntry.php +++ b/generated/Endpoint/CreateTimeEntry.php @@ -1,57 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateTimeEntry extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded. - + * Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded. + You should only use this method to create time entries when your account is configured to track time via duration. You can verify this by visiting the Settings page in your Harvest account or by checking if wants_timestamp_timers is false in the Company API. - * - * @param \JoliCode\Harvest\Api\Model\TimeEntriesPostBody $requestBody - */ + */ public function __construct(\JoliCode\Harvest\Api\Model\TimeEntriesPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/time_entries'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\TimeEntriesPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateUser.php b/generated/Endpoint/CreateUser.php index 958384e..5fce821 100644 --- a/generated/Endpoint/CreateUser.php +++ b/generated/Endpoint/CreateUser.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Creates a new user object and sends an invitation email to the address specified in the email parameter. Returns a user object and a 201 Created response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\UsersPostBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\UsersPostBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { return '/users'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\UsersPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/CreateUserAssignment.php b/generated/Endpoint/CreateUserAssignment.php index 8609109..4cc42b4 100644 --- a/generated/Endpoint/CreateUserAssignment.php +++ b/generated/Endpoint/CreateUserAssignment.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class CreateUserAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** * Creates a new user assignment object. Returns a user assignment object and a 201 Created response code if the call succeeded. - * - * @param string $projectId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody $requestBody */ public function __construct(string $projectId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody $requestBody) { $this->projectId = $projectId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'POST'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}/user_assignments'); + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}/user_assignments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsPostBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteClient.php b/generated/Endpoint/DeleteClient.php index 64ce8d9..8cc5a61 100644 --- a/generated/Endpoint/DeleteClient.php +++ b/generated/Endpoint/DeleteClient.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteClient extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $clientId; + /** * Delete a client. Deleting a client is only possible if it has no projects, invoices, or estimates associated with it. Returns a 200 OK response code if the call succeeded. - * - * @param string $clientId */ public function __construct(string $clientId) { $this->clientId = $clientId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{clientId}'], [$this->clientId], '/clients/{clientId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{clientId}'), array($this->clientId), '/clients/{clientId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteContact.php b/generated/Endpoint/DeleteContact.php index c36c7fb..2a5cc13 100644 --- a/generated/Endpoint/DeleteContact.php +++ b/generated/Endpoint/DeleteContact.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteContact extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $contactId; + /** * Delete a contact. Returns a 200 OK response code if the call succeeded. - * - * @param string $contactId */ public function __construct(string $contactId) { $this->contactId = $contactId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{contactId}'], [$this->contactId], '/contacts/{contactId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{contactId}'), array($this->contactId), '/contacts/{contactId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteEstimate.php b/generated/Endpoint/DeleteEstimate.php index 2186c09..18e7780 100644 --- a/generated/Endpoint/DeleteEstimate.php +++ b/generated/Endpoint/DeleteEstimate.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateId; + /** * Delete an estimate. Returns a 200 OK response code if the call succeeded. - * - * @param string $estimateId */ public function __construct(string $estimateId) { $this->estimateId = $estimateId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{estimateId}'], [$this->estimateId], '/estimates/{estimateId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{estimateId}'), array($this->estimateId), '/estimates/{estimateId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteEstimateItemCategory.php b/generated/Endpoint/DeleteEstimateItemCategory.php index c939764..e5e1e02 100644 --- a/generated/Endpoint/DeleteEstimateItemCategory.php +++ b/generated/Endpoint/DeleteEstimateItemCategory.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteEstimateItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateItemCategoryId; + /** * Delete an estimate item category. Returns a 200 OK response code if the call succeeded. - * - * @param string $estimateItemCategoryId */ public function __construct(string $estimateItemCategoryId) { $this->estimateItemCategoryId = $estimateItemCategoryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{estimateItemCategoryId}'], [$this->estimateItemCategoryId], '/estimate_item_categories/{estimateItemCategoryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{estimateItemCategoryId}'), array($this->estimateItemCategoryId), '/estimate_item_categories/{estimateItemCategoryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteEstimateMessage.php b/generated/Endpoint/DeleteEstimateMessage.php index 5f50579..1db2e6e 100644 --- a/generated/Endpoint/DeleteEstimateMessage.php +++ b/generated/Endpoint/DeleteEstimateMessage.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteEstimateMessage extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateId; protected $messageId; + /** * Delete an estimate message. Returns a 200 OK response code if the call succeeded. - * - * @param string $estimateId - * @param string $messageId */ public function __construct(string $estimateId, string $messageId) { $this->estimateId = $estimateId; $this->messageId = $messageId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{estimateId}', '{messageId}'], [$this->estimateId, $this->messageId], '/estimates/{estimateId}/messages/{messageId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{estimateId}', '{messageId}'), array($this->estimateId, $this->messageId), '/estimates/{estimateId}/messages/{messageId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteExpense.php b/generated/Endpoint/DeleteExpense.php index 535c94a..079cadb 100644 --- a/generated/Endpoint/DeleteExpense.php +++ b/generated/Endpoint/DeleteExpense.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteExpense extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $expenseId; + /** * Delete an expense. Returns a 200 OK response code if the call succeeded. - * - * @param string $expenseId */ public function __construct(string $expenseId) { $this->expenseId = $expenseId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{expenseId}'], [$this->expenseId], '/expenses/{expenseId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{expenseId}'), array($this->expenseId), '/expenses/{expenseId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteExpenseCategory.php b/generated/Endpoint/DeleteExpenseCategory.php index 6f00139..c0f86cc 100644 --- a/generated/Endpoint/DeleteExpenseCategory.php +++ b/generated/Endpoint/DeleteExpenseCategory.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteExpenseCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $expenseCategoryId; + /** * Delete an expense category. Returns a 200 OK response code if the call succeeded. - * - * @param string $expenseCategoryId */ public function __construct(string $expenseCategoryId) { $this->expenseCategoryId = $expenseCategoryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{expenseCategoryId}'], [$this->expenseCategoryId], '/expense_categories/{expenseCategoryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{expenseCategoryId}'), array($this->expenseCategoryId), '/expense_categories/{expenseCategoryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteInvoice.php b/generated/Endpoint/DeleteInvoice.php index 7166c0a..f4dd032 100644 --- a/generated/Endpoint/DeleteInvoice.php +++ b/generated/Endpoint/DeleteInvoice.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** * Delete an invoice. Returns a 200 OK response code if the call succeeded. - * - * @param string $invoiceId */ public function __construct(string $invoiceId) { $this->invoiceId = $invoiceId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteInvoiceItemCategory.php b/generated/Endpoint/DeleteInvoiceItemCategory.php index 1eadbd2..7b7cc83 100644 --- a/generated/Endpoint/DeleteInvoiceItemCategory.php +++ b/generated/Endpoint/DeleteInvoiceItemCategory.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteInvoiceItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceItemCategoryId; + /** * Delete an invoice item category. Deleting an invoice item category is only possible if use_as_service and use_as_expense are both false. Returns a 200 OK response code if the call succeeded. - * - * @param string $invoiceItemCategoryId */ public function __construct(string $invoiceItemCategoryId) { $this->invoiceItemCategoryId = $invoiceItemCategoryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{invoiceItemCategoryId}'], [$this->invoiceItemCategoryId], '/invoice_item_categories/{invoiceItemCategoryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{invoiceItemCategoryId}'), array($this->invoiceItemCategoryId), '/invoice_item_categories/{invoiceItemCategoryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteInvoiceMessage.php b/generated/Endpoint/DeleteInvoiceMessage.php index 3a423d4..3cef62a 100644 --- a/generated/Endpoint/DeleteInvoiceMessage.php +++ b/generated/Endpoint/DeleteInvoiceMessage.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteInvoiceMessage extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; protected $messageId; + /** * Delete an invoice message. Returns a 200 OK response code if the call succeeded. - * - * @param string $invoiceId - * @param string $messageId */ public function __construct(string $invoiceId, string $messageId) { $this->invoiceId = $invoiceId; $this->messageId = $messageId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{invoiceId}', '{messageId}'], [$this->invoiceId, $this->messageId], '/invoices/{invoiceId}/messages/{messageId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{invoiceId}', '{messageId}'), array($this->invoiceId, $this->messageId), '/invoices/{invoiceId}/messages/{messageId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteInvoicePayment.php b/generated/Endpoint/DeleteInvoicePayment.php index 1cb97ed..1cae053 100644 --- a/generated/Endpoint/DeleteInvoicePayment.php +++ b/generated/Endpoint/DeleteInvoicePayment.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteInvoicePayment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; protected $paymentId; + /** * Delete an invoice payment. Returns a 200 OK response code if the call succeeded. - * - * @param string $invoiceId - * @param string $paymentId */ public function __construct(string $invoiceId, string $paymentId) { $this->invoiceId = $invoiceId; $this->paymentId = $paymentId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{invoiceId}', '{paymentId}'], [$this->invoiceId, $this->paymentId], '/invoices/{invoiceId}/payments/{paymentId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{invoiceId}', '{paymentId}'), array($this->invoiceId, $this->paymentId), '/invoices/{invoiceId}/payments/{paymentId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteProject.php b/generated/Endpoint/DeleteProject.php index 919d53e..fc86404 100644 --- a/generated/Endpoint/DeleteProject.php +++ b/generated/Endpoint/DeleteProject.php @@ -1,55 +1,67 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteProject extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** - * Deletes a project and any time entries or expenses tracked to it. - However, invoices associated with the project will not be deleted. + * Deletes a project and any time entries or expenses tracked to it. If you don’t want the project’s time entries and expenses to be deleted, you should archive the project instead. - * - * @param string $projectId - */ + */ public function __construct(string $projectId) { $this->projectId = $projectId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteRole.php b/generated/Endpoint/DeleteRole.php index 9810336..3db748a 100644 --- a/generated/Endpoint/DeleteRole.php +++ b/generated/Endpoint/DeleteRole.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteRole extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $roleId; + /** * Delete a role. Deleting a role will unlink it from any users it was assigned to. Returns a 200 OK response code if the call succeeded. - * - * @param string $roleId */ public function __construct(string $roleId) { $this->roleId = $roleId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{roleId}'], [$this->roleId], '/roles/{roleId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{roleId}'), array($this->roleId), '/roles/{roleId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteTask.php b/generated/Endpoint/DeleteTask.php index a4b7463..62cce1a 100644 --- a/generated/Endpoint/DeleteTask.php +++ b/generated/Endpoint/DeleteTask.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteTask extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $taskId; + /** * Delete a task. Deleting a task is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded. - * - * @param string $taskId */ public function __construct(string $taskId) { $this->taskId = $taskId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{taskId}'], [$this->taskId], '/tasks/{taskId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{taskId}'), array($this->taskId), '/tasks/{taskId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteTaskAssignment.php b/generated/Endpoint/DeleteTaskAssignment.php index 9240e90..a38e568 100644 --- a/generated/Endpoint/DeleteTaskAssignment.php +++ b/generated/Endpoint/DeleteTaskAssignment.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteTaskAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; protected $taskAssignmentId; + /** * Delete a task assignment. Deleting a task assignment is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded. - * - * @param string $projectId - * @param string $taskAssignmentId */ public function __construct(string $projectId, string $taskAssignmentId) { $this->projectId = $projectId; $this->taskAssignmentId = $taskAssignmentId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{projectId}', '{taskAssignmentId}'], [$this->projectId, $this->taskAssignmentId], '/projects/{projectId}/task_assignments/{taskAssignmentId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{projectId}', '{taskAssignmentId}'), array($this->projectId, $this->taskAssignmentId), '/projects/{projectId}/task_assignments/{taskAssignmentId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteTimeEntry.php b/generated/Endpoint/DeleteTimeEntry.php index 965686a..932cd6e 100644 --- a/generated/Endpoint/DeleteTimeEntry.php +++ b/generated/Endpoint/DeleteTimeEntry.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteTimeEntry extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $timeEntryId; + /** * Delete a time entry. Deleting a time entry is only possible if it’s not closed and the associated project and task haven’t been archived. However, Admins can delete closed entries. Returns a 200 OK response code if the call succeeded. - * - * @param string $timeEntryId */ public function __construct(string $timeEntryId) { $this->timeEntryId = $timeEntryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{timeEntryId}'], [$this->timeEntryId], '/time_entries/{timeEntryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{timeEntryId}'), array($this->timeEntryId), '/time_entries/{timeEntryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteTimeEntryExternalReference.php b/generated/Endpoint/DeleteTimeEntryExternalReference.php index c7d66fc..27dfeca 100644 --- a/generated/Endpoint/DeleteTimeEntryExternalReference.php +++ b/generated/Endpoint/DeleteTimeEntryExternalReference.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteTimeEntryExternalReference extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $timeEntryId; + /** * Delete a time entry’s external reference. Returns a 200 OK response code if the call succeeded. - * - * @param string $timeEntryId */ public function __construct(string $timeEntryId) { $this->timeEntryId = $timeEntryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{timeEntryId}'], [$this->timeEntryId], '/time_entries/{timeEntryId}/external_reference'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{timeEntryId}'), array($this->timeEntryId), '/time_entries/{timeEntryId}/external_reference'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteUser.php b/generated/Endpoint/DeleteUser.php index 5f44d3f..0d18dac 100644 --- a/generated/Endpoint/DeleteUser.php +++ b/generated/Endpoint/DeleteUser.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** * Delete a user. Deleting a user is only possible if they have no time entries or expenses associated with them. Returns a 200 OK response code if the call succeeded. - * - * @param string $userId */ public function __construct(string $userId) { $this->userId = $userId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{userId}'], [$this->userId], '/users/{userId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/DeleteUserAssignment.php b/generated/Endpoint/DeleteUserAssignment.php index c6d81c1..3688cdd 100644 --- a/generated/Endpoint/DeleteUserAssignment.php +++ b/generated/Endpoint/DeleteUserAssignment.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class DeleteUserAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; protected $userAssignmentId; + /** * Delete a user assignment. Deleting a user assignment is only possible if it has no time entries or expenses associated with it. Returns a 200 OK response code if the call succeeded. - * - * @param string $projectId - * @param string $userAssignmentId */ public function __construct(string $projectId, string $userAssignmentId) { $this->projectId = $projectId; $this->userAssignmentId = $userAssignmentId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'DELETE'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{projectId}', '{userAssignmentId}'], [$this->projectId, $this->userAssignmentId], '/projects/{projectId}/user_assignments/{userAssignmentId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{projectId}', '{userAssignmentId}'), array($this->projectId, $this->userAssignmentId), '/projects/{projectId}/user_assignments/{userAssignmentId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Error + * @return \JoliCode\Harvest\Api\Model\Error|null */ protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { if (200 === $status) { return null; } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ExpenseCategoriesReport.php b/generated/Endpoint/ExpenseCategoriesReport.php index 9b367cb..8bfd82a 100644 --- a/generated/Endpoint/ExpenseCategoriesReport.php +++ b/generated/Endpoint/ExpenseCategoriesReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ExpenseCategoriesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/expenses/categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListActiveProjectAssignments.php b/generated/Endpoint/ListActiveProjectAssignments.php index a74414d..3ab7a95 100644 --- a/generated/Endpoint/ListActiveProjectAssignments.php +++ b/generated/Endpoint/ListActiveProjectAssignments.php @@ -1,72 +1,88 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListActiveProjectAssignments extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** - * Returns a list of active project assignments for the user identified by USER_ID. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. - - The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments. - * - * @param string $userId - * @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 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 100. (Default: 100) - * } - */ - public function __construct(string $userId, array $queryParameters = array()) + * Returns a list of active project assignments for the user identified by USER_ID. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. + + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(string $userId, array $queryParameters = []) { $this->userId = $userId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/project_assignments'); + return str_replace(['{userId}'], [$this->userId], '/users/{userId}/project_assignments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php b/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php index 6b9fd2f..134a937 100644 --- a/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php +++ b/generated/Endpoint/ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser.php @@ -1,67 +1,84 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your active project assignments for the currently authenticated user. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. - - The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments. - * - * @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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your active project assignments for the currently authenticated user. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first. + + * + * @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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/users/me/project_assignments'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ProjectAssignments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListBillableRatesForSpecificUser.php b/generated/Endpoint/ListBillableRatesForSpecificUser.php index 2ee5a51..5b7067e 100644 --- a/generated/Endpoint/ListBillableRatesForSpecificUser.php +++ b/generated/Endpoint/ListBillableRatesForSpecificUser.php @@ -1,70 +1,86 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListBillableRatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** - * Returns a list of billable rates for the user identified by USER_ID. The billable rates are returned sorted by start_date, with the oldest starting billable rates appearing first. - - The response contains an object with a billable_rates property that contains an array of up to per_page billable rates. Each entry in the array is a separate billable rate object. If no more billable rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your billable rates. - * - * @param string $userId - * @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 100. (Default: 100) - * } - */ - public function __construct(string $userId, array $queryParameters = array()) + * Returns a list of billable rates for the user identified by USER_ID. The billable rates are returned sorted by start_date, with the oldest starting billable rates appearing first. + + * + * @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 100. (Default: 100) + * } + */ + public function __construct(string $userId, array $queryParameters = []) { $this->userId = $userId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/billable_rates'); + return str_replace(['{userId}'], [$this->userId], '/users/{userId}/billable_rates'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\BillableRates|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRates', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListClients.php b/generated/Endpoint/ListClients.php index b2c35e7..83a969e 100644 --- a/generated/Endpoint/ListClients.php +++ b/generated/Endpoint/ListClients.php @@ -1,72 +1,89 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListClients extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your clients. The clients are returned sorted by creation date, with the most recently created clients appearing first. - - The response contains an object with a clients property that contains an array of up to per_page clients. Each entry in the array is a separate client object. If no more clients are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your clients. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your clients. The clients are returned sorted by creation date, with the most recently created clients appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/clients'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Clients|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Clients', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListContacts.php b/generated/Endpoint/ListContacts.php index 7e8a031..f8998c6 100644 --- a/generated/Endpoint/ListContacts.php +++ b/generated/Endpoint/ListContacts.php @@ -1,71 +1,88 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListContacts extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first. - - The response contains an object with a contacts property that contains an array of up to per_page contacts. Each entry in the array is a separate contact object. If no more contacts are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your contacts. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/contacts'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('client_id', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('client_id', array('int')); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['client_id', 'updated_since', 'page', '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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Contacts|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contacts', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListCostRatesForSpecificUser.php b/generated/Endpoint/ListCostRatesForSpecificUser.php index 4aca671..fe6ee54 100644 --- a/generated/Endpoint/ListCostRatesForSpecificUser.php +++ b/generated/Endpoint/ListCostRatesForSpecificUser.php @@ -1,70 +1,86 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListCostRatesForSpecificUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** - * Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first. - - The response contains an object with a cost_rates property that contains an array of up to per_page cost rates. Each entry in the array is a separate cost rate object. If no more cost rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your cost rates. - * - * @param string $userId - * @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 100. (Default: 100) - * } - */ - public function __construct(string $userId, array $queryParameters = array()) + * Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first. + + * + * @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 100. (Default: 100) + * } + */ + public function __construct(string $userId, array $queryParameters = []) { $this->userId = $userId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}/cost_rates'); + return str_replace(['{userId}'], [$this->userId], '/users/{userId}/cost_rates'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\CostRates|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRates', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListEstimateItemCategories.php b/generated/Endpoint/ListEstimateItemCategories.php index 11a78fa..3d41104 100644 --- a/generated/Endpoint/ListEstimateItemCategories.php +++ b/generated/Endpoint/ListEstimateItemCategories.php @@ -1,69 +1,86 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListEstimateItemCategories extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your estimate item categories. The estimate item categories are returned sorted by creation date, with the most recently created estimate item categories appearing first. - - The response contains an object with a estimate_item_categories property that contains an array of up to per_page estimate item categories. Each entry in the array is a separate estimate item category object. If no more estimate item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimate item categories. - * - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your estimate item categories. The estimate item categories are returned sorted by creation date, with the most recently created estimate item categories appearing first. + + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/estimate_item_categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategories|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListEstimates.php b/generated/Endpoint/ListEstimates.php index 432409d..e364e7e 100644 --- a/generated/Endpoint/ListEstimates.php +++ b/generated/Endpoint/ListEstimates.php @@ -1,77 +1,94 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListEstimates extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your estimates. The estimates are returned sorted by issue date, with the most recently issued estimates appearing first. - - The response contains an object with a estimates property that contains an array of up to per_page estimates. Each entry in the array is a separate estimate object. If no more estimates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimates. - * - * @param array $queryParameters { - * @var int $client_id Only return estimates belonging to the client with the given ID. - * @var string $updated_since Only return estimates that have been updated since the given date and time. - * @var string $from Only return estimates with an issue_date on or after the given date. - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your estimates. The estimates are returned sorted by issue date, with the most recently issued estimates appearing first. + + * + * @param array $queryParameters { + * + * @var int $client_id only return estimates belonging to the client with the given ID + * @var string $updated_since only return estimates that have been updated since the given date and time + * @var string $from only return estimates with an issue_date on or after the given date + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/estimates'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('client_id', 'updated_since', 'from', 'to', 'state', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('client_id', array('int')); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('state', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Estimates|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimates', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListExpenseCategories.php b/generated/Endpoint/ListExpenseCategories.php index c01a073..a970236 100644 --- a/generated/Endpoint/ListExpenseCategories.php +++ b/generated/Endpoint/ListExpenseCategories.php @@ -1,72 +1,89 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListExpenseCategories extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your expense categories. The expense categories are returned sorted by creation date, with the most recently created expense categories appearing first. - - The response contains an object with a expense_categories property that contains an array of up to per_page expense categories. Each entry in the array is a separate expense category object. If no more expense categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expense categories. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your expense categories. The expense categories are returned sorted by creation date, with the most recently created expense categories appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/expense_categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategories|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListExpenses.php b/generated/Endpoint/ListExpenses.php index 21a80bb..398459f 100644 --- a/generated/Endpoint/ListExpenses.php +++ b/generated/Endpoint/ListExpenses.php @@ -1,82 +1,99 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListExpenses extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your expenses. If accessing this endpoint as an Administrator, all expenses in the account will be returned. If accessing this endpoint as a Manager, all expenses for assigned teammates and managed projects will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first. - - The response contains an object with a expenses property that contains an array of up to per_page expenses. Each entry in the array is a separate expense object. If no more expenses are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expenses. - * - * @param array $queryParameters { - * @var int $user_id Only return expenses belonging to the user with the given ID. - * @var int $client_id Only return expenses belonging to the client with the given ID. - * @var int $project_id Only return expenses belonging to the project with the given ID. - * @var bool $is_billed Pass true to only return expenses that have been invoiced and false to return expenses that have not been invoiced. - * @var string $updated_since Only return expenses that have been updated since the given date and time. - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your expenses. If accessing this endpoint as an Administrator, all expenses in the account will be returned. If accessing this endpoint as a Manager, all expenses for assigned teammates and managed projects will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first. + + * + * @param array $queryParameters { + * + * @var int $user_id only return expenses belonging to the user with the given ID + * @var int $client_id only return expenses belonging to the client with the given ID + * @var int $project_id only return expenses belonging to the project with the given ID + * @var bool $is_billed pass true to only return expenses that have been invoiced and false to return expenses that have not been invoiced + * @var string $updated_since only return expenses that have been updated since the given date and time + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/expenses'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('user_id', 'client_id', 'project_id', 'is_billed', 'updated_since', 'from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('user_id', array('int')); - $optionsResolver->setAllowedTypes('client_id', array('int')); - $optionsResolver->setAllowedTypes('project_id', array('int')); - $optionsResolver->setAllowedTypes('is_billed', array('bool')); - $optionsResolver->setNormalizer('is_billed', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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->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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Expenses|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expenses', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListInvoiceItemCategories.php b/generated/Endpoint/ListInvoiceItemCategories.php index eb4da0c..85dbc09 100644 --- a/generated/Endpoint/ListInvoiceItemCategories.php +++ b/generated/Endpoint/ListInvoiceItemCategories.php @@ -1,69 +1,86 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListInvoiceItemCategories extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your invoice item categories. The invoice item categories are returned sorted by creation date, with the most recently created invoice item categories appearing first. - - The response contains an object with a invoice_item_categories property that contains an array of up to per_page invoice item categories. Each entry in the array is a separate invoice item category object. If no more invoice item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoice item categories. - * - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your invoice item categories. The invoice item categories are returned sorted by creation date, with the most recently created invoice item categories appearing first. + + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/invoice_item_categories'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategories|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListInvoices.php b/generated/Endpoint/ListInvoices.php index 710f1aa..b85da26 100644 --- a/generated/Endpoint/ListInvoices.php +++ b/generated/Endpoint/ListInvoices.php @@ -1,79 +1,96 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListInvoices extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first. - - The response contains an object with a invoices property that contains an array of up to per_page invoices. Each entry in the array is a separate invoice object. If no more invoices are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoices. - * - * @param array $queryParameters { - * @var int $client_id Only return invoices belonging to the client with the given ID. - * @var int $project_id Only return invoices associated with the project with the given ID. - * @var string $updated_since Only return invoices that have been updated since the given date and time. - * @var string $from Only return invoices with an issue_date on or after the given date. - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first. + + * + * @param array $queryParameters { + * + * @var int $client_id only return invoices belonging to the client with the given ID + * @var int $project_id only return invoices associated with the project with the given ID + * @var string $updated_since only return invoices that have been updated since the given date and time + * @var string $from only return invoices with an issue_date on or after the given date + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/invoices'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('client_id', 'project_id', 'updated_since', 'from', 'to', 'state', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('client_id', array('int')); - $optionsResolver->setAllowedTypes('project_id', array('int')); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('state', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Invoices|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoices', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListMessagesForEstimate.php b/generated/Endpoint/ListMessagesForEstimate.php index 3de8a27..d4ee298 100644 --- a/generated/Endpoint/ListMessagesForEstimate.php +++ b/generated/Endpoint/ListMessagesForEstimate.php @@ -1,72 +1,88 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListMessagesForEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateId; + /** - * Returns a list of messages associated with a given estimate. The estimate messages are returned sorted by creation date, with the most recently created messages appearing first. - - The response contains an object with an estimate_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages. - * - * @param string $estimateId - * @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 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 100. (Default: 100) - * } - */ - public function __construct(string $estimateId, array $queryParameters = array()) + * Returns a list of messages associated with a given estimate. The estimate messages are returned sorted by creation date, with the most recently created messages appearing first. + + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(string $estimateId, array $queryParameters = []) { $this->estimateId = $estimateId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{estimateId}'), array($this->estimateId), '/estimates/{estimateId}/messages'); + return str_replace(['{estimateId}'], [$this->estimateId], '/estimates/{estimateId}/messages'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateMessages|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListMessagesForInvoice.php b/generated/Endpoint/ListMessagesForInvoice.php index 5742c4f..3d14686 100644 --- a/generated/Endpoint/ListMessagesForInvoice.php +++ b/generated/Endpoint/ListMessagesForInvoice.php @@ -1,72 +1,88 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListMessagesForInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** - * Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first. - - The response contains an object with an invoice_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages. - * - * @param string $invoiceId - * @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 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 100. (Default: 100) - * } - */ - public function __construct(string $invoiceId, array $queryParameters = array()) + * Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first. + + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(string $invoiceId, array $queryParameters = []) { $this->invoiceId = $invoiceId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}/messages'); + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}/messages'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceMessages|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListPaymentsForInvoice.php b/generated/Endpoint/ListPaymentsForInvoice.php index c7caf34..b6b7186 100644 --- a/generated/Endpoint/ListPaymentsForInvoice.php +++ b/generated/Endpoint/ListPaymentsForInvoice.php @@ -1,72 +1,88 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListPaymentsForInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** - * Returns a list of payments associate with a given invoice. The payments are returned sorted by creation date, with the most recently created payments appearing first. - - The response contains an object with an invoice_payments property that contains an array of up to per_page payments. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your payments. - * - * @param string $invoiceId - * @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 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 100. (Default: 100) - * } - */ - public function __construct(string $invoiceId, array $queryParameters = array()) + * Returns a list of payments associate with a given invoice. The payments are returned sorted by creation date, with the most recently created payments appearing first. + + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(string $invoiceId, array $queryParameters = []) { $this->invoiceId = $invoiceId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}/payments'); + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}/payments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoicePayments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListProjects.php b/generated/Endpoint/ListProjects.php index ee1d199..1fafaee 100644 --- a/generated/Endpoint/ListProjects.php +++ b/generated/Endpoint/ListProjects.php @@ -1,74 +1,91 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListProjects extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your projects. The projects are returned sorted by creation date, with the most recently created projects appearing first. - - The response contains an object with a projects property that contains an array of up to per_page projects. Each entry in the array is a separate project object. If no more projects are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your projects. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your projects. The projects are returned sorted by creation date, with the most recently created projects appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/projects'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'client_id', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('client_id', array('int')); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'client_id', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Projects|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Projects', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListRoles.php b/generated/Endpoint/ListRoles.php index b310436..7b950d7 100644 --- a/generated/Endpoint/ListRoles.php +++ b/generated/Endpoint/ListRoles.php @@ -1,67 +1,84 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListRoles extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first. - - The response contains an object with a roles property that contains an array of up to per_page roles. Each entry in the array is a separate role object. If no more roles are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your roles. - * - * @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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first. + + * + * @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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/roles'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Roles|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Roles', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListTaskAssignments.php b/generated/Endpoint/ListTaskAssignments.php index 5ac298f..cc6d0c5 100644 --- a/generated/Endpoint/ListTaskAssignments.php +++ b/generated/Endpoint/ListTaskAssignments.php @@ -1,72 +1,89 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListTaskAssignments extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. - - The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/task_assignments'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php b/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php index bbb8a9a..fa54f87 100644 --- a/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php +++ b/generated/Endpoint/ListTaskAssignmentsForSpecificProject.php @@ -1,75 +1,91 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListTaskAssignmentsForSpecificProject extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** - * Returns a list of your task assignments for the project identified by PROJECT_ID. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. - - The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments. - * - * @param string $projectId - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(string $projectId, array $queryParameters = array()) + * Returns a list of your task assignments for the project identified by PROJECT_ID. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(string $projectId, array $queryParameters = []) { $this->projectId = $projectId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}/task_assignments'); + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}/task_assignments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListTasks.php b/generated/Endpoint/ListTasks.php index d39593f..aeccbea 100644 --- a/generated/Endpoint/ListTasks.php +++ b/generated/Endpoint/ListTasks.php @@ -1,72 +1,89 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListTasks extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your tasks. The tasks are returned sorted by creation date, with the most recently created tasks appearing first. - - The response contains an object with a tasks property that contains an array of up to per_page tasks. Each entry in the array is a separate task object. If no more tasks are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your tasks. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your tasks. The tasks are returned sorted by creation date, with the most recently created tasks appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/tasks'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Tasks|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Tasks', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListTimeEntries.php b/generated/Endpoint/ListTimeEntries.php index 4e8c29d..511c1fe 100644 --- a/generated/Endpoint/ListTimeEntries.php +++ b/generated/Endpoint/ListTimeEntries.php @@ -1,89 +1,106 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListTimeEntries extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of time entries. The time entries are returned sorted by spent_date date. At this time, the sort option can’t be customized. - - The response contains an object with a time_entries property that contains an array of up to per_page time entries. Each entry in the array is a separate time entry object. If no more time entries are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your time entries. - * - * @param array $queryParameters { - * @var int $user_id Only return time entries belonging to the user with the given ID. - * @var int $client_id Only return time entries belonging to the client with the given ID. - * @var int $project_id Only return time entries belonging to the project with the given ID. - * @var int $task_id Only return time entries belonging to the task with the given ID. - * @var string $external_reference_id Only return time entries with the given external_reference ID. - * @var bool $is_billed Pass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced. - * @var bool $is_running Pass true to only return running time entries and false to return non-running time entries. - * @var string $updated_since Only return time entries that have been updated since the given date and time. Use the ISO 8601 Format. - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of time entries. The time entries are returned sorted by spent_date date. At this time, the sort option can’t be customized. + + * + * @param array $queryParameters { + * + * @var int $user_id only return time entries belonging to the user with the given ID + * @var int $client_id only return time entries belonging to the client with the given ID + * @var int $project_id only return time entries belonging to the project with the given ID + * @var int $task_id only return time entries belonging to the task with the given ID + * @var string $external_reference_id only return time entries with the given external_reference ID + * @var bool $is_billed pass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced + * @var bool $is_running pass true to only return running time entries and false to return non-running time entries + * @var string $updated_since Only return time entries that have been updated since the given date and time. Use the ISO 8601 Format. + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/time_entries'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('user_id', 'client_id', 'project_id', 'task_id', 'external_reference_id', 'is_billed', 'is_running', 'updated_since', 'from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('user_id', array('int')); - $optionsResolver->setAllowedTypes('client_id', array('int')); - $optionsResolver->setAllowedTypes('project_id', array('int')); - $optionsResolver->setAllowedTypes('task_id', array('int')); - $optionsResolver->setAllowedTypes('external_reference_id', array('string')); - $optionsResolver->setAllowedTypes('is_billed', array('bool')); - $optionsResolver->setNormalizer('is_billed', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('is_running', array('bool')); - $optionsResolver->setNormalizer('is_running', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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->setNormalizer('is_billed', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntries|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntries', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListUserAssignments.php b/generated/Endpoint/ListUserAssignments.php index b2b83f3..ab0ad42 100644 --- a/generated/Endpoint/ListUserAssignments.php +++ b/generated/Endpoint/ListUserAssignments.php @@ -1,74 +1,91 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListUserAssignments extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your projects user assignments, active and archived. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. - - The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your projects user assignments, active and archived. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/user_assignments'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('user_id', 'is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('user_id', array('int')); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListUserAssignmentsForSpecificProject.php b/generated/Endpoint/ListUserAssignmentsForSpecificProject.php index c3b6d42..d0be760 100644 --- a/generated/Endpoint/ListUserAssignmentsForSpecificProject.php +++ b/generated/Endpoint/ListUserAssignmentsForSpecificProject.php @@ -1,77 +1,93 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListUserAssignmentsForSpecificProject extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** - * Returns a list of user assignments for the project identified by PROJECT_ID. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. - - The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments. - * - * @param string $projectId - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(string $projectId, array $queryParameters = array()) + * Returns a list of user assignments for the project identified by PROJECT_ID. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(string $projectId, array $queryParameters = []) { $this->projectId = $projectId; $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}/user_assignments'); + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}/user_assignments'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('user_id', 'is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('user_id', array('int')); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); + $optionsResolver->setAllowedTypes('updated_since', ['string']); + $optionsResolver->setAllowedTypes('page', ['int']); + $optionsResolver->setAllowedTypes('per_page', ['int']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignments|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignments', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ListUsers.php b/generated/Endpoint/ListUsers.php index 1710bcd..73eaa84 100644 --- a/generated/Endpoint/ListUsers.php +++ b/generated/Endpoint/ListUsers.php @@ -1,72 +1,89 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ListUsers extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first. - - The response contains an object with a users property that contains an array of up to per_page users. Each entry in the array is a separate user object. If no more users are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your users. - * - * @param array $queryParameters { - * @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 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 100. (Default: 100) - * } - */ - public function __construct(array $queryParameters = array()) + * Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first. + + * + * @param array $queryParameters { + * + * @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 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 100. (Default: 100) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/users'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('is_active', 'updated_since', 'page', 'per_page')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); - $optionsResolver->setAllowedTypes('updated_since', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $optionsResolver->setDefined(['is_active', 'updated_since', 'page', 'per_page']); + $optionsResolver->setRequired([]); + $optionsResolver->setDefaults([]); + $optionsResolver->setAllowedTypes('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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Users|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Users', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ProjectBudgetReport.php b/generated/Endpoint/ProjectBudgetReport.php index ff4764e..7aa566c 100644 --- a/generated/Endpoint/ProjectBudgetReport.php +++ b/generated/Endpoint/ProjectBudgetReport.php @@ -1,68 +1,86 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ProjectBudgetReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results. * * @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 1000. (Default: 1000) * @var bool $is_active Pass true to only return active projects and false to return inactive projects. * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/project_budget'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('page', 'per_page', 'is_active')); - $optionsResolver->setRequired(array()); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); - $optionsResolver->setAllowedTypes('is_active', array('bool')); - $optionsResolver->setNormalizer('is_active', \Closure::fromCallable(array(new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'))); + $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->setNormalizer('is_active', \Closure::fromCallable([new \JoliCode\Harvest\BooleanCustomQueryResolver(), '__invoke'])); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ProjectBudgetReportResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ProjectsExpensesReport.php b/generated/Endpoint/ProjectsExpensesReport.php index 5230bb0..981fbf6 100644 --- a/generated/Endpoint/ProjectsExpensesReport.php +++ b/generated/Endpoint/ProjectsExpensesReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ProjectsExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/expenses/projects'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/ProjectsTimeReport.php b/generated/Endpoint/ProjectsTimeReport.php index 911c509..3d6556e 100644 --- a/generated/Endpoint/ProjectsTimeReport.php +++ b/generated/Endpoint/ProjectsTimeReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class ProjectsTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/time/projects'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RestartStoppedTimeEntry.php b/generated/Endpoint/RestartStoppedTimeEntry.php index 59ff894..177d9d2 100644 --- a/generated/Endpoint/RestartStoppedTimeEntry.php +++ b/generated/Endpoint/RestartStoppedTimeEntry.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RestartStoppedTimeEntry extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $timeEntryId; + /** * Restarting a time entry is only possible if it isn’t currently running. Returns a 200 OK response code if the call succeeded. - * - * @param string $timeEntryId */ public function __construct(string $timeEntryId) { $this->timeEntryId = $timeEntryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{timeEntryId}'], [$this->timeEntryId], '/time_entries/{timeEntryId}/restart'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{timeEntryId}'), array($this->timeEntryId), '/time_entries/{timeEntryId}/restart'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveBillableRate.php b/generated/Endpoint/RetrieveBillableRate.php index e8ac00d..917a392 100644 --- a/generated/Endpoint/RetrieveBillableRate.php +++ b/generated/Endpoint/RetrieveBillableRate.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveBillableRate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; protected $billableRateId; + /** * Retrieves the billable rate with the given ID. Returns a billable rate object and a 200 OK response code if a valid identifier was provided. - * - * @param string $userId - * @param string $billableRateId */ public function __construct(string $userId, string $billableRateId) { $this->userId = $userId; $this->billableRateId = $billableRateId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{userId}', '{billableRateId}'], [$this->userId, $this->billableRateId], '/users/{userId}/billable_rates/{billableRateId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{userId}', '{billableRateId}'), array($this->userId, $this->billableRateId), '/users/{userId}/billable_rates/{billableRateId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\BillableRate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveClient.php b/generated/Endpoint/RetrieveClient.php index 92edb66..c53e604 100644 --- a/generated/Endpoint/RetrieveClient.php +++ b/generated/Endpoint/RetrieveClient.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveClient extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $clientId; + /** * Retrieves the client with the given ID. Returns a client object and a 200 OK response code if a valid identifier was provided. - * - * @param string $clientId */ public function __construct(string $clientId) { $this->clientId = $clientId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{clientId}'], [$this->clientId], '/clients/{clientId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{clientId}'), array($this->clientId), '/clients/{clientId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveCompany.php b/generated/Endpoint/RetrieveCompany.php index 70d0f25..1c02103 100644 --- a/generated/Endpoint/RetrieveCompany.php +++ b/generated/Endpoint/RetrieveCompany.php @@ -1,43 +1,57 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveCompany extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/company'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Company', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveContact.php b/generated/Endpoint/RetrieveContact.php index 09d4cb6..b295687 100644 --- a/generated/Endpoint/RetrieveContact.php +++ b/generated/Endpoint/RetrieveContact.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveContact extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $contactId; + /** * Retrieves the contact with the given ID. Returns a contact object and a 200 OK response code if a valid identifier was provided. - * - * @param string $contactId */ public function __construct(string $contactId) { $this->contactId = $contactId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{contactId}'], [$this->contactId], '/contacts/{contactId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{contactId}'), array($this->contactId), '/contacts/{contactId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveCostRate.php b/generated/Endpoint/RetrieveCostRate.php index 40b4ffb..15c6a24 100644 --- a/generated/Endpoint/RetrieveCostRate.php +++ b/generated/Endpoint/RetrieveCostRate.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveCostRate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; protected $costRateId; + /** * Retrieves the cost rate with the given ID. Returns a cost rate object and a 200 OK response code if a valid identifier was provided. - * - * @param string $userId - * @param string $costRateId */ public function __construct(string $userId, string $costRateId) { $this->userId = $userId; $this->costRateId = $costRateId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{userId}', '{costRateId}'], [$this->userId, $this->costRateId], '/users/{userId}/cost_rates/{costRateId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{userId}', '{costRateId}'), array($this->userId, $this->costRateId), '/users/{userId}/cost_rates/{costRateId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\CostRate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveEstimate.php b/generated/Endpoint/RetrieveEstimate.php index 5282a84..0f96e64 100644 --- a/generated/Endpoint/RetrieveEstimate.php +++ b/generated/Endpoint/RetrieveEstimate.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateId; + /** * Retrieves the estimate with the given ID. Returns an estimate object and a 200 OK response code if a valid identifier was provided. - * - * @param string $estimateId */ public function __construct(string $estimateId) { $this->estimateId = $estimateId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{estimateId}'], [$this->estimateId], '/estimates/{estimateId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{estimateId}'), array($this->estimateId), '/estimates/{estimateId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveEstimateItemCategory.php b/generated/Endpoint/RetrieveEstimateItemCategory.php index 10fd59c..8dd757a 100644 --- a/generated/Endpoint/RetrieveEstimateItemCategory.php +++ b/generated/Endpoint/RetrieveEstimateItemCategory.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveEstimateItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateItemCategoryId; + /** * Retrieves the estimate item category with the given ID. Returns an estimate item category object and a 200 OK response code if a valid identifier was provided. - * - * @param string $estimateItemCategoryId */ public function __construct(string $estimateItemCategoryId) { $this->estimateItemCategoryId = $estimateItemCategoryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{estimateItemCategoryId}'], [$this->estimateItemCategoryId], '/estimate_item_categories/{estimateItemCategoryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{estimateItemCategoryId}'), array($this->estimateItemCategoryId), '/estimate_item_categories/{estimateItemCategoryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveExpense.php b/generated/Endpoint/RetrieveExpense.php index d0c4de3..cea52b2 100644 --- a/generated/Endpoint/RetrieveExpense.php +++ b/generated/Endpoint/RetrieveExpense.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveExpense extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $expenseId; + /** * Retrieves the expense with the given ID. Returns an expense object and a 200 OK response code if a valid identifier was provided. - * - * @param string $expenseId */ public function __construct(string $expenseId) { $this->expenseId = $expenseId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{expenseId}'], [$this->expenseId], '/expenses/{expenseId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{expenseId}'), array($this->expenseId), '/expenses/{expenseId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveExpenseCategory.php b/generated/Endpoint/RetrieveExpenseCategory.php index 72bcc64..12ddb2a 100644 --- a/generated/Endpoint/RetrieveExpenseCategory.php +++ b/generated/Endpoint/RetrieveExpenseCategory.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveExpenseCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $expenseCategoryId; + /** * Retrieves the expense category with the given ID. Returns an expense category object and a 200 OK response code if a valid identifier was provided. - * - * @param string $expenseCategoryId */ public function __construct(string $expenseCategoryId) { $this->expenseCategoryId = $expenseCategoryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{expenseCategoryId}'], [$this->expenseCategoryId], '/expense_categories/{expenseCategoryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{expenseCategoryId}'), array($this->expenseCategoryId), '/expense_categories/{expenseCategoryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveInvoice.php b/generated/Endpoint/RetrieveInvoice.php index a08ba9f..3b4bc6c 100644 --- a/generated/Endpoint/RetrieveInvoice.php +++ b/generated/Endpoint/RetrieveInvoice.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** * Retrieves the invoice with the given ID. Returns an invoice object and a 200 OK response code if a valid identifier was provided. - * - * @param string $invoiceId */ public function __construct(string $invoiceId) { $this->invoiceId = $invoiceId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveInvoiceItemCategory.php b/generated/Endpoint/RetrieveInvoiceItemCategory.php index 077c8dd..2ce2e3d 100644 --- a/generated/Endpoint/RetrieveInvoiceItemCategory.php +++ b/generated/Endpoint/RetrieveInvoiceItemCategory.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveInvoiceItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceItemCategoryId; + /** * Retrieves the invoice item category with the given ID. Returns an invoice item category object and a 200 OK response code if a valid identifier was provided. - * - * @param string $invoiceItemCategoryId */ public function __construct(string $invoiceItemCategoryId) { $this->invoiceItemCategoryId = $invoiceItemCategoryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{invoiceItemCategoryId}'], [$this->invoiceItemCategoryId], '/invoice_item_categories/{invoiceItemCategoryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{invoiceItemCategoryId}'), array($this->invoiceItemCategoryId), '/invoice_item_categories/{invoiceItemCategoryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveProject.php b/generated/Endpoint/RetrieveProject.php index 8663fd7..c99fd80 100644 --- a/generated/Endpoint/RetrieveProject.php +++ b/generated/Endpoint/RetrieveProject.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveProject extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** * Retrieves the project with the given ID. Returns a project object and a 200 OK response code if a valid identifier was provided. - * - * @param string $projectId */ public function __construct(string $projectId) { $this->projectId = $projectId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveRole.php b/generated/Endpoint/RetrieveRole.php index fc54a3f..0565fbd 100644 --- a/generated/Endpoint/RetrieveRole.php +++ b/generated/Endpoint/RetrieveRole.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveRole extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $roleId; + /** * Retrieves the role with the given ID. Returns a role object and a 200 OK response code if a valid identifier was provided. - * - * @param string $roleId */ public function __construct(string $roleId) { $this->roleId = $roleId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{roleId}'], [$this->roleId], '/roles/{roleId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{roleId}'), array($this->roleId), '/roles/{roleId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveTask.php b/generated/Endpoint/RetrieveTask.php index 4f4d353..21c14c6 100644 --- a/generated/Endpoint/RetrieveTask.php +++ b/generated/Endpoint/RetrieveTask.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveTask extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $taskId; + /** * Retrieves the task with the given ID. Returns a task object and a 200 OK response code if a valid identifier was provided. - * - * @param string $taskId */ public function __construct(string $taskId) { $this->taskId = $taskId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{taskId}'], [$this->taskId], '/tasks/{taskId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{taskId}'), array($this->taskId), '/tasks/{taskId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveTaskAssignment.php b/generated/Endpoint/RetrieveTaskAssignment.php index d5e0e3d..7245d24 100644 --- a/generated/Endpoint/RetrieveTaskAssignment.php +++ b/generated/Endpoint/RetrieveTaskAssignment.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveTaskAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; protected $taskAssignmentId; + /** * Retrieves the task assignment with the given ID. Returns a task assignment object and a 200 OK response code if a valid identifier was provided. - * - * @param string $projectId - * @param string $taskAssignmentId */ public function __construct(string $projectId, string $taskAssignmentId) { $this->projectId = $projectId; $this->taskAssignmentId = $taskAssignmentId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{projectId}', '{taskAssignmentId}'], [$this->projectId, $this->taskAssignmentId], '/projects/{projectId}/task_assignments/{taskAssignmentId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{projectId}', '{taskAssignmentId}'), array($this->projectId, $this->taskAssignmentId), '/projects/{projectId}/task_assignments/{taskAssignmentId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php b/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php index 157c44b..e98d6c9 100644 --- a/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php +++ b/generated/Endpoint/RetrieveTheCurrentlyAuthenticatedUser.php @@ -1,43 +1,57 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveTheCurrentlyAuthenticatedUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/users/me'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array + { + return [[], null]; + } + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveTimeEntry.php b/generated/Endpoint/RetrieveTimeEntry.php index f65e894..6f6a547 100644 --- a/generated/Endpoint/RetrieveTimeEntry.php +++ b/generated/Endpoint/RetrieveTimeEntry.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveTimeEntry extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $timeEntryId; + /** * Retrieves the time entry with the given ID. Returns a time entry object and a 200 OK response code if a valid identifier was provided. - * - * @param string $timeEntryId */ public function __construct(string $timeEntryId) { $this->timeEntryId = $timeEntryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{timeEntryId}'], [$this->timeEntryId], '/time_entries/{timeEntryId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{timeEntryId}'), array($this->timeEntryId), '/time_entries/{timeEntryId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveUser.php b/generated/Endpoint/RetrieveUser.php index b66affa..e890ec1 100644 --- a/generated/Endpoint/RetrieveUser.php +++ b/generated/Endpoint/RetrieveUser.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** * Retrieves the user with the given ID. Returns a user object and a 200 OK response code if a valid identifier was provided. - * - * @param string $userId */ public function __construct(string $userId) { $this->userId = $userId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{userId}'], [$this->userId], '/users/{userId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/RetrieveUserAssignment.php b/generated/Endpoint/RetrieveUserAssignment.php index 873f4a9..8bf72ae 100644 --- a/generated/Endpoint/RetrieveUserAssignment.php +++ b/generated/Endpoint/RetrieveUserAssignment.php @@ -1,56 +1,68 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class RetrieveUserAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; protected $userAssignmentId; + /** * Retrieves the user assignment with the given ID. Returns a user assignment object and a 200 OK response code if a valid identifier was provided. - * - * @param string $projectId - * @param string $userAssignmentId */ public function __construct(string $projectId, string $userAssignmentId) { $this->projectId = $projectId; $this->userAssignmentId = $userAssignmentId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{projectId}', '{userAssignmentId}'], [$this->projectId, $this->userAssignmentId], '/projects/{projectId}/user_assignments/{userAssignmentId}'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{projectId}', '{userAssignmentId}'), array($this->projectId, $this->userAssignmentId), '/projects/{projectId}/user_assignments/{userAssignmentId}'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/StopRunningTimeEntry.php b/generated/Endpoint/StopRunningTimeEntry.php index f3eafab..6ba10a4 100644 --- a/generated/Endpoint/StopRunningTimeEntry.php +++ b/generated/Endpoint/StopRunningTimeEntry.php @@ -1,53 +1,66 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class StopRunningTimeEntry extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $timeEntryId; + /** * Stopping a time entry is only possible if it’s currently running. Returns a 200 OK response code if the call succeeded. - * - * @param string $timeEntryId */ public function __construct(string $timeEntryId) { $this->timeEntryId = $timeEntryId; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string + { + return str_replace(['{timeEntryId}'], [$this->timeEntryId], '/time_entries/{timeEntryId}/stop'); + } + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return str_replace(array('{timeEntryId}'), array($this->timeEntryId), '/time_entries/{timeEntryId}/stop'); + return [[], null]; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getExtraHeaders(): array { - return array(array(), null); + return ['Accept' => ['application/json']]; } - public function getExtraHeaders() : array + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/TasksReport.php b/generated/Endpoint/TasksReport.php index 80311c6..85cd23c 100644 --- a/generated/Endpoint/TasksReport.php +++ b/generated/Endpoint/TasksReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class TasksReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/time/tasks'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/TeamExpensesReport.php b/generated/Endpoint/TeamExpensesReport.php index 5fbe616..ad0c240 100644 --- a/generated/Endpoint/TeamExpensesReport.php +++ b/generated/Endpoint/TeamExpensesReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class TeamExpensesReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/expenses/team'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/TeamTimeReport.php b/generated/Endpoint/TeamTimeReport.php index 7a56a44..2d7f541 100644 --- a/generated/Endpoint/TeamTimeReport.php +++ b/generated/Endpoint/TeamTimeReport.php @@ -1,69 +1,85 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class TeamTimeReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * - * * @param array $queryParameters { - * @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 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 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 1000. (Default: 1000) * } */ - public function __construct(array $queryParameters = array()) + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/time/team'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeReportsResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UninvoicedReport.php b/generated/Endpoint/UninvoicedReport.php index 836d80d..7ea0666 100644 --- a/generated/Endpoint/UninvoicedReport.php +++ b/generated/Endpoint/UninvoicedReport.php @@ -1,71 +1,88 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UninvoicedReport extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** - * The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results. - - Note: Each request requires both the from and to parameters to be supplied in the URL’s query string. The timeframe supplied cannot exceed 1 year (365 days). - * - * @param array $queryParameters { - * @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 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 1000. (Default: 1000) - * } - */ - public function __construct(array $queryParameters = array()) + * The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results. + + * + * @param array $queryParameters { + * + * @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 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 1000. (Default: 1000) + * } + */ + public function __construct(array $queryParameters = []) { $this->queryParameters = $queryParameters; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'GET'; } - public function getUri() : string + + public function getUri(): string { return '/reports/uninvoiced'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - return array(array(), null); + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array { - return array('Accept' => array('application/json')); + return ['Accept' => ['application/json']]; } - protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver + + public function getAuthenticationScopes(): array + { + return ['BearerAuth', 'AccountAuth']; + } + + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); - $optionsResolver->setDefined(array('from', 'to', 'page', 'per_page')); - $optionsResolver->setRequired(array('from', 'to')); - $optionsResolver->setDefaults(array()); - $optionsResolver->setAllowedTypes('from', array('string')); - $optionsResolver->setAllowedTypes('to', array('string')); - $optionsResolver->setAllowedTypes('page', array('int')); - $optionsResolver->setAllowedTypes('per_page', array('int')); + $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']); + return $optionsResolver; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\UninvoicedReportResults|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateClient.php b/generated/Endpoint/UpdateClient.php index ca8700a..ab41ab6 100644 --- a/generated/Endpoint/UpdateClient.php +++ b/generated/Endpoint/UpdateClient.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateClient extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $clientId; + /** * Updates the specific client by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a client object and a 200 OK response code if the call succeeded. - * - * @param string $clientId - * @param \JoliCode\Harvest\Api\Model\ClientsClientIdPatchBody $requestBody */ public function __construct(string $clientId, \JoliCode\Harvest\Api\Model\ClientsClientIdPatchBody $requestBody) { $this->clientId = $clientId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{clientId}'), array($this->clientId), '/clients/{clientId}'); + return str_replace(['{clientId}'], [$this->clientId], '/clients/{clientId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ClientsClientIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Client|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateCompany.php b/generated/Endpoint/UpdateCompany.php index 35fdf6c..346b816 100644 --- a/generated/Endpoint/UpdateCompany.php +++ b/generated/Endpoint/UpdateCompany.php @@ -1,55 +1,69 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateCompany extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; + /** * Updates the company setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a company object and a 200 OK response code if the call succeeded. - * - * @param \JoliCode\Harvest\Api\Model\CompanyPatchBody $requestBody */ public function __construct(\JoliCode\Harvest\Api\Model\CompanyPatchBody $requestBody) { $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { return '/company'; } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\CompanyPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Company|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Company', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateContact.php b/generated/Endpoint/UpdateContact.php index bcfc0e4..bec7e2f 100644 --- a/generated/Endpoint/UpdateContact.php +++ b/generated/Endpoint/UpdateContact.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateContact extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $contactId; + /** * Updates the specific contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a contact object and a 200 OK response code if the call succeeded. - * - * @param string $contactId - * @param \JoliCode\Harvest\Api\Model\ContactsContactIdPatchBody $requestBody */ public function __construct(string $contactId, \JoliCode\Harvest\Api\Model\ContactsContactIdPatchBody $requestBody) { $this->contactId = $contactId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{contactId}'), array($this->contactId), '/contacts/{contactId}'); + return str_replace(['{contactId}'], [$this->contactId], '/contacts/{contactId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ContactsContactIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Contact|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateEstimate.php b/generated/Endpoint/UpdateEstimate.php index b2724c0..f604960 100644 --- a/generated/Endpoint/UpdateEstimate.php +++ b/generated/Endpoint/UpdateEstimate.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateEstimate extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateId; + /** * Updates the specific estimate by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate object and a 200 OK response code if the call succeeded. - * - * @param string $estimateId - * @param \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody $requestBody */ public function __construct(string $estimateId, \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody $requestBody) { $this->estimateId = $estimateId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{estimateId}'), array($this->estimateId), '/estimates/{estimateId}'); + return str_replace(['{estimateId}'], [$this->estimateId], '/estimates/{estimateId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\EstimatesEstimateIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Estimate|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateEstimateItemCategory.php b/generated/Endpoint/UpdateEstimateItemCategory.php index 8daebc2..511b2a3 100644 --- a/generated/Endpoint/UpdateEstimateItemCategory.php +++ b/generated/Endpoint/UpdateEstimateItemCategory.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateEstimateItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $estimateItemCategoryId; + /** * Updates the specific estimate item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate item category object and a 200 OK response code if the call succeeded. - * - * @param string $estimateItemCategoryId - * @param \JoliCode\Harvest\Api\Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody $requestBody */ public function __construct(string $estimateItemCategoryId, \JoliCode\Harvest\Api\Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody $requestBody) { $this->estimateItemCategoryId = $estimateItemCategoryId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{estimateItemCategoryId}'), array($this->estimateItemCategoryId), '/estimate_item_categories/{estimateItemCategoryId}'); + return str_replace(['{estimateItemCategoryId}'], [$this->estimateItemCategoryId], '/estimate_item_categories/{estimateItemCategoryId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\EstimateItemCategoriesEstimateItemCategoryIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\EstimateItemCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateExpense.php b/generated/Endpoint/UpdateExpense.php index 02df605..f7a9aaa 100644 --- a/generated/Endpoint/UpdateExpense.php +++ b/generated/Endpoint/UpdateExpense.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateExpense extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $expenseId; + /** * Updates the specific expense by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense object and a 200 OK response code if the call succeeded. - * - * @param string $expenseId - * @param \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody $requestBody */ public function __construct(string $expenseId, \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody $requestBody) { $this->expenseId = $expenseId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{expenseId}'), array($this->expenseId), '/expenses/{expenseId}'); + return str_replace(['{expenseId}'], [$this->expenseId], '/expenses/{expenseId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ExpensesExpenseIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Expense|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateExpenseCategory.php b/generated/Endpoint/UpdateExpenseCategory.php index ca829e7..5b4f3af 100644 --- a/generated/Endpoint/UpdateExpenseCategory.php +++ b/generated/Endpoint/UpdateExpenseCategory.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateExpenseCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $expenseCategoryId; + /** * Updates the specific expense category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense category object and a 200 OK response code if the call succeeded. - * - * @param string $expenseCategoryId - * @param \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody $requestBody */ public function __construct(string $expenseCategoryId, \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody $requestBody) { $this->expenseCategoryId = $expenseCategoryId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{expenseCategoryId}'), array($this->expenseCategoryId), '/expense_categories/{expenseCategoryId}'); + return str_replace(['{expenseCategoryId}'], [$this->expenseCategoryId], '/expense_categories/{expenseCategoryId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ExpenseCategoriesExpenseCategoryIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\ExpenseCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateInvoice.php b/generated/Endpoint/UpdateInvoice.php index 8be2f22..f47ae7b 100644 --- a/generated/Endpoint/UpdateInvoice.php +++ b/generated/Endpoint/UpdateInvoice.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateInvoice extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceId; + /** * Updates the specific invoice by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice object and a 200 OK response code if the call succeeded. - * - * @param string $invoiceId - * @param \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody $requestBody */ public function __construct(string $invoiceId, \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody $requestBody) { $this->invoiceId = $invoiceId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{invoiceId}'), array($this->invoiceId), '/invoices/{invoiceId}'); + return str_replace(['{invoiceId}'], [$this->invoiceId], '/invoices/{invoiceId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\InvoicesInvoiceIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Invoice|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateInvoiceItemCategory.php b/generated/Endpoint/UpdateInvoiceItemCategory.php index 7493187..86ff46d 100644 --- a/generated/Endpoint/UpdateInvoiceItemCategory.php +++ b/generated/Endpoint/UpdateInvoiceItemCategory.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateInvoiceItemCategory extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $invoiceItemCategoryId; + /** * Updates the specific invoice item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice item category object and a 200 OK response code if the call succeeded. - * - * @param string $invoiceItemCategoryId - * @param \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody $requestBody */ public function __construct(string $invoiceItemCategoryId, \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody $requestBody) { $this->invoiceItemCategoryId = $invoiceItemCategoryId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{invoiceItemCategoryId}'), array($this->invoiceItemCategoryId), '/invoice_item_categories/{invoiceItemCategoryId}'); + return str_replace(['{invoiceItemCategoryId}'], [$this->invoiceItemCategoryId], '/invoice_item_categories/{invoiceItemCategoryId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\InvoiceItemCategory|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateProject.php b/generated/Endpoint/UpdateProject.php index 54033b1..07d318e 100644 --- a/generated/Endpoint/UpdateProject.php +++ b/generated/Endpoint/UpdateProject.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateProject extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; + /** * Updates the specific project by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a project object and a 200 OK response code if the call succeeded. - * - * @param string $projectId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody $requestBody */ public function __construct(string $projectId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody $requestBody) { $this->projectId = $projectId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}'), array($this->projectId), '/projects/{projectId}'); + return str_replace(['{projectId}'], [$this->projectId], '/projects/{projectId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ProjectsProjectIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Project|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateRole.php b/generated/Endpoint/UpdateRole.php index 71d250d..9416034 100644 --- a/generated/Endpoint/UpdateRole.php +++ b/generated/Endpoint/UpdateRole.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateRole extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $roleId; + /** * Updates the specific role by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a role object and a 200 OK response code if the call succeeded. - * - * @param string $roleId - * @param \JoliCode\Harvest\Api\Model\RolesRoleIdPatchBody $requestBody */ public function __construct(string $roleId, \JoliCode\Harvest\Api\Model\RolesRoleIdPatchBody $requestBody) { $this->roleId = $roleId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{roleId}'), array($this->roleId), '/roles/{roleId}'); + return str_replace(['{roleId}'], [$this->roleId], '/roles/{roleId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\RolesRoleIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Role|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateTask.php b/generated/Endpoint/UpdateTask.php index 4a94ac3..4afb4a1 100644 --- a/generated/Endpoint/UpdateTask.php +++ b/generated/Endpoint/UpdateTask.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateTask extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $taskId; + /** * Updates the specific task by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task object and a 200 OK response code if the call succeeded. - * - * @param string $taskId - * @param \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody $requestBody */ public function __construct(string $taskId, \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody $requestBody) { $this->taskId = $taskId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{taskId}'), array($this->taskId), '/tasks/{taskId}'); + return str_replace(['{taskId}'], [$this->taskId], '/tasks/{taskId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\TasksTaskIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\Task|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateTaskAssignment.php b/generated/Endpoint/UpdateTaskAssignment.php index f984a8d..760a03b 100644 --- a/generated/Endpoint/UpdateTaskAssignment.php +++ b/generated/Endpoint/UpdateTaskAssignment.php @@ -1,17 +1,24 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateTaskAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; protected $taskAssignmentId; + /** * Updates the specific task assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task assignment object and a 200 OK response code if the call succeeded. - * - * @param string $projectId - * @param string $taskAssignmentId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody $requestBody */ public function __construct(string $projectId, string $taskAssignmentId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody $requestBody) { @@ -19,43 +26,48 @@ public function __construct(string $projectId, string $taskAssignmentId, \JoliCo $this->taskAssignmentId = $taskAssignmentId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}', '{taskAssignmentId}'), array($this->projectId, $this->taskAssignmentId), '/projects/{projectId}/task_assignments/{taskAssignmentId}'); + return str_replace(['{projectId}', '{taskAssignmentId}'], [$this->projectId, $this->taskAssignmentId], '/projects/{projectId}/task_assignments/{taskAssignmentId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TaskAssignment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateTimeEntry.php b/generated/Endpoint/UpdateTimeEntry.php index 83c1600..9139930 100644 --- a/generated/Endpoint/UpdateTimeEntry.php +++ b/generated/Endpoint/UpdateTimeEntry.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateTimeEntry extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $timeEntryId; + /** * Updates the specific time entry by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a time entry object and a 200 OK response code if the call succeeded. - * - * @param string $timeEntryId - * @param \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody $requestBody */ public function __construct(string $timeEntryId, \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody $requestBody) { $this->timeEntryId = $timeEntryId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{timeEntryId}'), array($this->timeEntryId), '/time_entries/{timeEntryId}'); + return str_replace(['{timeEntryId}'], [$this->timeEntryId], '/time_entries/{timeEntryId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\TimeEntriesTimeEntryIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\TimeEntry|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateUser.php b/generated/Endpoint/UpdateUser.php index 61d6cca..2983471 100644 --- a/generated/Endpoint/UpdateUser.php +++ b/generated/Endpoint/UpdateUser.php @@ -1,58 +1,71 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateUser extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $userId; + /** * Updates the specific user by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user object and a 200 OK response code if the call succeeded. - * - * @param string $userId - * @param \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody $requestBody */ public function __construct(string $userId, \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody $requestBody) { $this->userId = $userId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{userId}'), array($this->userId), '/users/{userId}'); + return str_replace(['{userId}'], [$this->userId], '/users/{userId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\UsersUserIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\User|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\User', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Endpoint/UpdateUserAssignment.php b/generated/Endpoint/UpdateUserAssignment.php index 172dc33..5f009de 100644 --- a/generated/Endpoint/UpdateUserAssignment.php +++ b/generated/Endpoint/UpdateUserAssignment.php @@ -1,17 +1,24 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Endpoint; class UpdateUserAssignment extends \JoliCode\Harvest\Api\Runtime\Client\BaseEndpoint implements \JoliCode\Harvest\Api\Runtime\Client\Endpoint { + use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; protected $projectId; protected $userAssignmentId; + /** * Updates the specific user assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user assignment object and a 200 OK response code if the call succeeded. - * - * @param string $projectId - * @param string $userAssignmentId - * @param \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody $requestBody */ public function __construct(string $projectId, string $userAssignmentId, \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody $requestBody) { @@ -19,43 +26,48 @@ public function __construct(string $projectId, string $userAssignmentId, \JoliCo $this->userAssignmentId = $userAssignmentId; $this->body = $requestBody; } - use \JoliCode\Harvest\Api\Runtime\Client\EndpointTrait; - public function getMethod() : string + + public function getMethod(): string { return 'PATCH'; } - public function getUri() : string + + public function getUri(): string { - return str_replace(array('{projectId}', '{userAssignmentId}'), array($this->projectId, $this->userAssignmentId), '/projects/{projectId}/user_assignments/{userAssignmentId}'); + return str_replace(['{projectId}', '{userAssignmentId}'], [$this->projectId, $this->userAssignmentId], '/projects/{projectId}/user_assignments/{userAssignmentId}'); } - public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array + + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if ($this->body instanceof \JoliCode\Harvest\Api\Model\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody) { - return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json')); + return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - return array(array(), null); + + return [[], null]; } - public function getExtraHeaders() : array + + public function getExtraHeaders(): array + { + return ['Accept' => ['application/json']]; + } + + public function getAuthenticationScopes(): array { - return array('Accept' => array('application/json')); + return ['BearerAuth', 'AccountAuth']; } + /** * {@inheritdoc} * - * - * @return null|\JoliCode\Harvest\Api\Model\UserAssignment|\JoliCode\Harvest\Api\Model\Error + * @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) { - if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) { + if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json'); } - if (mb_strpos($contentType, 'application/json') !== false) { + if (false !== mb_strpos($contentType, 'application/json')) { return $serializer->deserialize($body, 'JoliCode\\Harvest\\Api\\Model\\Error', 'json'); } } - public function getAuthenticationScopes() : array - { - return array('BearerAuth', 'AccountAuth'); - } -} \ No newline at end of file +} diff --git a/generated/Model/BillableRate.php b/generated/Model/BillableRate.php index cf897b5..bffbd12 100644 --- a/generated/Model/BillableRate.php +++ b/generated/Model/BillableRate.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class BillableRate @@ -40,130 +49,112 @@ class BillableRate * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the billable rate. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the billable rate. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The amount of the billable rate. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The amount of the billable rate. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * The date the billable rate is effective. - * - * @return \DateTime|null */ - public function getStartDate() : ?\DateTime + public function getStartDate(): ?\DateTime { return $this->startDate; } + /** * The date the billable rate is effective. - * - * @param \DateTime|null $startDate - * - * @return self */ - public function setStartDate(?\DateTime $startDate) : self + public function setStartDate(?\DateTime $startDate): self { $this->startDate = $startDate; + return $this; } + /** * The date the billable rate is no longer effective. This date is calculated by Harvest. - * - * @return \DateTime|null */ - public function getEndDate() : ?\DateTime + public function getEndDate(): ?\DateTime { return $this->endDate; } + /** * The date the billable rate is no longer effective. This date is calculated by Harvest. - * - * @param \DateTime|null $endDate - * - * @return self */ - public function setEndDate(?\DateTime $endDate) : self + public function setEndDate(?\DateTime $endDate): self { $this->endDate = $endDate; + return $this; } + /** * Date and time the billable rate was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the billable rate was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the billable rate was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the billable rate was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/BillableRates.php b/generated/Model/BillableRates.php index c3868e8..d56d200 100644 --- a/generated/Model/BillableRates.php +++ b/generated/Model/BillableRates.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class BillableRates { /** - * - * * @var BillableRate[] */ protected $billableRates; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return BillableRate[] */ - public function getBillableRates() : array + public function getBillableRates(): array { return $this->billableRates; } + /** - * - * * @param BillableRate[] $billableRates - * - * @return self */ - public function setBillableRates(array $billableRates) : self + public function setBillableRates(array $billableRates): self { $this->billableRates = $billableRates; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Client.php b/generated/Model/Client.php index 85f6b6d..8a082aa 100644 --- a/generated/Model/Client.php +++ b/generated/Model/Client.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Client @@ -29,7 +38,7 @@ class Client */ protected $address; /** - * Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY} + * Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY}. * * @var string|null */ @@ -52,172 +61,148 @@ class Client * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the client. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the client. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * A textual description of the client. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * A textual description of the client. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Whether the client is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the client is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * The physical address for the client. - * - * @return string|null */ - public function getAddress() : ?string + public function getAddress(): ?string { return $this->address; } + /** * The physical address for the client. - * - * @param string|null $address - * - * @return self */ - public function setAddress(?string $address) : self + public function setAddress(?string $address): self { $this->address = $address; + return $this; } + /** - * Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY} - * - * @return string|null + * Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY}. */ - public function getStatementKey() : ?string + public function getStatementKey(): ?string { return $this->statementKey; } + /** - * Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY} - * - * @param string|null $statementKey - * - * @return self + * Used to build a URL to your client’s invoice dashboard:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/statements/{STATEMENT_KEY}. */ - public function setStatementKey(?string $statementKey) : self + public function setStatementKey(?string $statementKey): self { $this->statementKey = $statementKey; + return $this; } + /** * The currency code associated with this client. - * - * @return string|null */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** * The currency code associated with this client. - * - * @param string|null $currency - * - * @return self */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * Date and time the client was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the client was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the client was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the client was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Clients.php b/generated/Model/Clients.php index 851d997..d305d9d 100644 --- a/generated/Model/Clients.php +++ b/generated/Model/Clients.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Clients { /** - * - * * @var Client[] */ protected $clients; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Client[] */ - public function getClients() : array + public function getClients(): array { return $this->clients; } + /** - * - * * @param Client[] $clients - * - * @return self */ - public function setClients(array $clients) : self + public function setClients(array $clients): self { $this->clients = $clients; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ClientsClientIdPatchBody.php b/generated/Model/ClientsClientIdPatchBody.php index e193a9f..d0c994f 100644 --- a/generated/Model/ClientsClientIdPatchBody.php +++ b/generated/Model/ClientsClientIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ClientsClientIdPatchBody @@ -23,93 +32,81 @@ class ClientsClientIdPatchBody */ protected $address; /** - * The currency used by the client. See a list of supported currencies + * The currency used by the client. See a list of supported currencies. * * @var string|null */ protected $currency; + /** * A textual description of the client. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * A textual description of the client. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Whether the client is active, or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the client is active, or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * A textual representation of the client’s physical address. May include new line characters. - * - * @return string|null */ - public function getAddress() : ?string + public function getAddress(): ?string { return $this->address; } + /** * A textual representation of the client’s physical address. May include new line characters. - * - * @param string|null $address - * - * @return self */ - public function setAddress(?string $address) : self + public function setAddress(?string $address): self { $this->address = $address; + return $this; } + /** - * The currency used by the client. See a list of supported currencies - * - * @return string|null + * The currency used by the client. See a list of supported currencies. */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** - * The currency used by the client. See a list of supported currencies - * - * @param string|null $currency - * - * @return self + * The currency used by the client. See a list of supported currencies. */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ClientsPostBody.php b/generated/Model/ClientsPostBody.php index fd7bb33..2d2c778 100644 --- a/generated/Model/ClientsPostBody.php +++ b/generated/Model/ClientsPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ClientsPostBody @@ -23,93 +32,81 @@ class ClientsPostBody */ protected $address; /** - * The currency used by the client. If not provided, the company’s currency will be used. See a list of supported currencies + * The currency used by the client. If not provided, the company’s currency will be used. See a list of supported currencies. * * @var string|null */ protected $currency; + /** * A textual description of the client. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * A textual description of the client. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Whether the client is active, or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the client is active, or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * A textual representation of the client’s physical address. May include new line characters. - * - * @return string|null */ - public function getAddress() : ?string + public function getAddress(): ?string { return $this->address; } + /** * A textual representation of the client’s physical address. May include new line characters. - * - * @param string|null $address - * - * @return self */ - public function setAddress(?string $address) : self + public function setAddress(?string $address): self { $this->address = $address; + return $this; } + /** - * The currency used by the client. If not provided, the company’s currency will be used. See a list of supported currencies - * - * @return string|null + * The currency used by the client. If not provided, the company’s currency will be used. See a list of supported currencies. */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** - * The currency used by the client. If not provided, the company’s currency will be used. See a list of supported currencies - * - * @param string|null $currency - * - * @return self + * The currency used by the client. If not provided, the company’s currency will be used. See a list of supported currencies. */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Companies.php b/generated/Model/Companies.php index a1f2727..13c5559 100644 --- a/generated/Model/Companies.php +++ b/generated/Model/Companies.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Companies { /** - * - * * @var Company[] */ protected $companies; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Company[] */ - public function getCompanies() : array + public function getCompanies(): array { return $this->companies; } + /** - * - * * @param Company[] $companies - * - * @return self */ - public function setCompanies(array $companies) : self + public function setCompanies(array $companies): self { $this->companies = $companies; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Company.php b/generated/Model/Company.php index 548159b..da034cb 100644 --- a/generated/Model/Company.php +++ b/generated/Model/Company.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Company @@ -53,7 +62,7 @@ class Company */ protected $dateFormat; /** - * The type of plan the company is on. Examples: trial, free, or simple-v4 + * The type of plan the company is on. Examples: trial, free, or simple-v4. * * @var string|null */ @@ -124,424 +133,364 @@ class Company * @var bool|null */ protected $approvalFeature; + /** * The Harvest URL for the company. - * - * @return string|null */ - public function getBaseUri() : ?string + public function getBaseUri(): ?string { return $this->baseUri; } + /** * The Harvest URL for the company. - * - * @param string|null $baseUri - * - * @return self */ - public function setBaseUri(?string $baseUri) : self + public function setBaseUri(?string $baseUri): self { $this->baseUri = $baseUri; + return $this; } + /** * The Harvest domain for the company. - * - * @return string|null */ - public function getFullDomain() : ?string + public function getFullDomain(): ?string { return $this->fullDomain; } + /** * The Harvest domain for the company. - * - * @param string|null $fullDomain - * - * @return self */ - public function setFullDomain(?string $fullDomain) : self + public function setFullDomain(?string $fullDomain): self { $this->fullDomain = $fullDomain; + return $this; } + /** * The name of the company. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the company. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Whether the company is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the company is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * The weekday used as the start of the week. Returns one of: Saturday, Sunday, or Monday. - * - * @return string|null */ - public function getWeekStartDay() : ?string + public function getWeekStartDay(): ?string { return $this->weekStartDay; } + /** * The weekday used as the start of the week. Returns one of: Saturday, Sunday, or Monday. - * - * @param string|null $weekStartDay - * - * @return self */ - public function setWeekStartDay(?string $weekStartDay) : self + public function setWeekStartDay(?string $weekStartDay): self { $this->weekStartDay = $weekStartDay; + return $this; } + /** * Whether time is tracked via duration or start and end times. - * - * @return bool|null */ - public function getWantsTimestampTimers() : ?bool + public function getWantsTimestampTimers(): ?bool { return $this->wantsTimestampTimers; } + /** * Whether time is tracked via duration or start and end times. - * - * @param bool|null $wantsTimestampTimers - * - * @return self */ - public function setWantsTimestampTimers(?bool $wantsTimestampTimers) : self + public function setWantsTimestampTimers(?bool $wantsTimestampTimers): self { $this->wantsTimestampTimers = $wantsTimestampTimers; + return $this; } + /** * The format used to display time in Harvest. Returns either decimal or hours_minutes. - * - * @return string|null */ - public function getTimeFormat() : ?string + public function getTimeFormat(): ?string { return $this->timeFormat; } + /** * The format used to display time in Harvest. Returns either decimal or hours_minutes. - * - * @param string|null $timeFormat - * - * @return self */ - public function setTimeFormat(?string $timeFormat) : self + public function setTimeFormat(?string $timeFormat): self { $this->timeFormat = $timeFormat; + return $this; } + /** * The format used to display date in Harvest. Returns one of: %m/%d/%Y, %d/%m/%Y, %Y-%m-%d, %d.%m.%Y,.%Y.%m.%d or %Y/%m/%d. - * - * @return string|null */ - public function getDateFormat() : ?string + public function getDateFormat(): ?string { return $this->dateFormat; } + /** * The format used to display date in Harvest. Returns one of: %m/%d/%Y, %d/%m/%Y, %Y-%m-%d, %d.%m.%Y,.%Y.%m.%d or %Y/%m/%d. - * - * @param string|null $dateFormat - * - * @return self */ - public function setDateFormat(?string $dateFormat) : self + public function setDateFormat(?string $dateFormat): self { $this->dateFormat = $dateFormat; + return $this; } + /** - * The type of plan the company is on. Examples: trial, free, or simple-v4 - * - * @return string|null + * The type of plan the company is on. Examples: trial, free, or simple-v4. */ - public function getPlanType() : ?string + public function getPlanType(): ?string { return $this->planType; } + /** - * The type of plan the company is on. Examples: trial, free, or simple-v4 - * - * @param string|null $planType - * - * @return self + * The type of plan the company is on. Examples: trial, free, or simple-v4. */ - public function setPlanType(?string $planType) : self + public function setPlanType(?string $planType): self { $this->planType = $planType; + return $this; } + /** * Used to represent whether the company is using a 12-hour or 24-hour clock. Returns either 12h or 24h. - * - * @return string|null */ - public function getClock() : ?string + public function getClock(): ?string { return $this->clock; } + /** * Used to represent whether the company is using a 12-hour or 24-hour clock. Returns either 12h or 24h. - * - * @param string|null $clock - * - * @return self */ - public function setClock(?string $clock) : self + public function setClock(?string $clock): self { $this->clock = $clock; + return $this; } + /** * How to display the currency code when formatting currency. Returns one of: iso_code_none, iso_code_before, or iso_code_after. - * - * @return string|null */ - public function getCurrencyCodeDisplay() : ?string + public function getCurrencyCodeDisplay(): ?string { return $this->currencyCodeDisplay; } + /** * How to display the currency code when formatting currency. Returns one of: iso_code_none, iso_code_before, or iso_code_after. - * - * @param string|null $currencyCodeDisplay - * - * @return self */ - public function setCurrencyCodeDisplay(?string $currencyCodeDisplay) : self + public function setCurrencyCodeDisplay(?string $currencyCodeDisplay): self { $this->currencyCodeDisplay = $currencyCodeDisplay; + return $this; } + /** * How to display the currency symbol when formatting currency. Returns one of: symbol_none, symbol_before, or symbol_after. - * - * @return string|null */ - public function getCurrencySymbolDisplay() : ?string + public function getCurrencySymbolDisplay(): ?string { return $this->currencySymbolDisplay; } + /** * How to display the currency symbol when formatting currency. Returns one of: symbol_none, symbol_before, or symbol_after. - * - * @param string|null $currencySymbolDisplay - * - * @return self */ - public function setCurrencySymbolDisplay(?string $currencySymbolDisplay) : self + public function setCurrencySymbolDisplay(?string $currencySymbolDisplay): self { $this->currencySymbolDisplay = $currencySymbolDisplay; + return $this; } + /** * Symbol used when formatting decimals. - * - * @return string|null */ - public function getDecimalSymbol() : ?string + public function getDecimalSymbol(): ?string { return $this->decimalSymbol; } + /** * Symbol used when formatting decimals. - * - * @param string|null $decimalSymbol - * - * @return self */ - public function setDecimalSymbol(?string $decimalSymbol) : self + public function setDecimalSymbol(?string $decimalSymbol): self { $this->decimalSymbol = $decimalSymbol; + return $this; } + /** * Separator used when formatting numbers. - * - * @return string|null */ - public function getThousandsSeparator() : ?string + public function getThousandsSeparator(): ?string { return $this->thousandsSeparator; } + /** * Separator used when formatting numbers. - * - * @param string|null $thousandsSeparator - * - * @return self */ - public function setThousandsSeparator(?string $thousandsSeparator) : self + public function setThousandsSeparator(?string $thousandsSeparator): self { $this->thousandsSeparator = $thousandsSeparator; + return $this; } + /** * The color scheme being used in the Harvest web client. - * - * @return string|null */ - public function getColorScheme() : ?string + public function getColorScheme(): ?string { return $this->colorScheme; } + /** * The color scheme being used in the Harvest web client. - * - * @param string|null $colorScheme - * - * @return self */ - public function setColorScheme(?string $colorScheme) : self + public function setColorScheme(?string $colorScheme): self { $this->colorScheme = $colorScheme; + return $this; } + /** * The weekly capacity in seconds. - * - * @return int|null */ - public function getWeeklyCapacity() : ?int + public function getWeeklyCapacity(): ?int { return $this->weeklyCapacity; } + /** * The weekly capacity in seconds. - * - * @param int|null $weeklyCapacity - * - * @return self */ - public function setWeeklyCapacity(?int $weeklyCapacity) : self + public function setWeeklyCapacity(?int $weeklyCapacity): self { $this->weeklyCapacity = $weeklyCapacity; + return $this; } + /** * Whether the expense module is enabled. - * - * @return bool|null */ - public function getExpenseFeature() : ?bool + public function getExpenseFeature(): ?bool { return $this->expenseFeature; } + /** * Whether the expense module is enabled. - * - * @param bool|null $expenseFeature - * - * @return self */ - public function setExpenseFeature(?bool $expenseFeature) : self + public function setExpenseFeature(?bool $expenseFeature): self { $this->expenseFeature = $expenseFeature; + return $this; } + /** * Whether the invoice module is enabled. - * - * @return bool|null */ - public function getInvoiceFeature() : ?bool + public function getInvoiceFeature(): ?bool { return $this->invoiceFeature; } + /** * Whether the invoice module is enabled. - * - * @param bool|null $invoiceFeature - * - * @return self */ - public function setInvoiceFeature(?bool $invoiceFeature) : self + public function setInvoiceFeature(?bool $invoiceFeature): self { $this->invoiceFeature = $invoiceFeature; + return $this; } + /** * Whether the estimate module is enabled. - * - * @return bool|null */ - public function getEstimateFeature() : ?bool + public function getEstimateFeature(): ?bool { return $this->estimateFeature; } + /** * Whether the estimate module is enabled. - * - * @param bool|null $estimateFeature - * - * @return self */ - public function setEstimateFeature(?bool $estimateFeature) : self + public function setEstimateFeature(?bool $estimateFeature): self { $this->estimateFeature = $estimateFeature; + return $this; } + /** * Whether the approval module is enabled. - * - * @return bool|null */ - public function getApprovalFeature() : ?bool + public function getApprovalFeature(): ?bool { return $this->approvalFeature; } + /** * Whether the approval module is enabled. - * - * @param bool|null $approvalFeature - * - * @return self */ - public function setApprovalFeature(?bool $approvalFeature) : self + public function setApprovalFeature(?bool $approvalFeature): self { $this->approvalFeature = $approvalFeature; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/CompanyPatchBody.php b/generated/Model/CompanyPatchBody.php index 895a23c..1665667 100644 --- a/generated/Model/CompanyPatchBody.php +++ b/generated/Model/CompanyPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class CompanyPatchBody @@ -16,46 +25,40 @@ class CompanyPatchBody * @var int|null */ protected $weeklyCapacity; + /** * Whether time is tracked via duration or start and end times. - * - * @return bool|null */ - public function getWantsTimestampTimers() : ?bool + public function getWantsTimestampTimers(): ?bool { return $this->wantsTimestampTimers; } + /** * Whether time is tracked via duration or start and end times. - * - * @param bool|null $wantsTimestampTimers - * - * @return self */ - public function setWantsTimestampTimers(?bool $wantsTimestampTimers) : self + public function setWantsTimestampTimers(?bool $wantsTimestampTimers): self { $this->wantsTimestampTimers = $wantsTimestampTimers; + return $this; } + /** * The weekly capacity in seconds. - * - * @return int|null */ - public function getWeeklyCapacity() : ?int + public function getWeeklyCapacity(): ?int { return $this->weeklyCapacity; } + /** * The weekly capacity in seconds. - * - * @param int|null $weeklyCapacity - * - * @return self */ - public function setWeeklyCapacity(?int $weeklyCapacity) : self + public function setWeeklyCapacity(?int $weeklyCapacity): self { $this->weeklyCapacity = $weeklyCapacity; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Contact.php b/generated/Model/Contact.php index faa1278..6628711 100644 --- a/generated/Model/Contact.php +++ b/generated/Model/Contact.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Contact @@ -70,235 +79,202 @@ class Contact * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the contact. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the contact. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing the contact’s client id and name. - * - * @return ContactClient|null */ - public function getClient() : ?ContactClient + public function getClient(): ?ContactClient { return $this->client; } + /** * An object containing the contact’s client id and name. - * - * @param ContactClient|null $client - * - * @return self */ - public function setClient(?ContactClient $client) : self + public function setClient(?ContactClient $client): self { $this->client = $client; + return $this; } + /** * The title of the contact. - * - * @return string|null */ - public function getTitle() : ?string + public function getTitle(): ?string { return $this->title; } + /** * The title of the contact. - * - * @param string|null $title - * - * @return self */ - public function setTitle(?string $title) : self + public function setTitle(?string $title): self { $this->title = $title; + return $this; } + /** * The first name of the contact. - * - * @return string|null */ - public function getFirstName() : ?string + public function getFirstName(): ?string { return $this->firstName; } + /** * The first name of the contact. - * - * @param string|null $firstName - * - * @return self */ - public function setFirstName(?string $firstName) : self + public function setFirstName(?string $firstName): self { $this->firstName = $firstName; + return $this; } + /** * The last name of the contact. - * - * @return string|null */ - public function getLastName() : ?string + public function getLastName(): ?string { return $this->lastName; } + /** * The last name of the contact. - * - * @param string|null $lastName - * - * @return self */ - public function setLastName(?string $lastName) : self + public function setLastName(?string $lastName): self { $this->lastName = $lastName; + return $this; } + /** * The contact’s email address. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * The contact’s email address. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } + /** * The contact’s office phone number. - * - * @return string|null */ - public function getPhoneOffice() : ?string + public function getPhoneOffice(): ?string { return $this->phoneOffice; } + /** * The contact’s office phone number. - * - * @param string|null $phoneOffice - * - * @return self */ - public function setPhoneOffice(?string $phoneOffice) : self + public function setPhoneOffice(?string $phoneOffice): self { $this->phoneOffice = $phoneOffice; + return $this; } + /** * The contact’s mobile phone number. - * - * @return string|null */ - public function getPhoneMobile() : ?string + public function getPhoneMobile(): ?string { return $this->phoneMobile; } + /** * The contact’s mobile phone number. - * - * @param string|null $phoneMobile - * - * @return self */ - public function setPhoneMobile(?string $phoneMobile) : self + public function setPhoneMobile(?string $phoneMobile): self { $this->phoneMobile = $phoneMobile; + return $this; } + /** * The contact’s fax number. - * - * @return string|null */ - public function getFax() : ?string + public function getFax(): ?string { return $this->fax; } + /** * The contact’s fax number. - * - * @param string|null $fax - * - * @return self */ - public function setFax(?string $fax) : self + public function setFax(?string $fax): self { $this->fax = $fax; + return $this; } + /** * Date and time the contact was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the contact was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the contact was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the contact was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ContactClient.php b/generated/Model/ContactClient.php index db7da27..5c5ad1b 100644 --- a/generated/Model/ContactClient.php +++ b/generated/Model/ContactClient.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ContactClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Contacts.php b/generated/Model/Contacts.php index 2e4e04e..e5d8e31 100644 --- a/generated/Model/Contacts.php +++ b/generated/Model/Contacts.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Contacts { /** - * - * * @var Contact[] */ protected $contacts; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Contact[] */ - public function getContacts() : array + public function getContacts(): array { return $this->contacts; } + /** - * - * * @param Contact[] $contacts - * - * @return self */ - public function setContacts(array $contacts) : self + public function setContacts(array $contacts): self { $this->contacts = $contacts; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ContactsContactIdPatchBody.php b/generated/Model/ContactsContactIdPatchBody.php index ce4f1ad..1b4426d 100644 --- a/generated/Model/ContactsContactIdPatchBody.php +++ b/generated/Model/ContactsContactIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ContactsContactIdPatchBody @@ -52,172 +61,148 @@ class ContactsContactIdPatchBody * @var string|null */ protected $fax; + /** * The ID of the client associated with this contact. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client associated with this contact. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The title of the contact. - * - * @return string|null */ - public function getTitle() : ?string + public function getTitle(): ?string { return $this->title; } + /** * The title of the contact. - * - * @param string|null $title - * - * @return self */ - public function setTitle(?string $title) : self + public function setTitle(?string $title): self { $this->title = $title; + return $this; } + /** * The first name of the contact. - * - * @return string|null */ - public function getFirstName() : ?string + public function getFirstName(): ?string { return $this->firstName; } + /** * The first name of the contact. - * - * @param string|null $firstName - * - * @return self */ - public function setFirstName(?string $firstName) : self + public function setFirstName(?string $firstName): self { $this->firstName = $firstName; + return $this; } + /** * The last name of the contact. - * - * @return string|null */ - public function getLastName() : ?string + public function getLastName(): ?string { return $this->lastName; } + /** * The last name of the contact. - * - * @param string|null $lastName - * - * @return self */ - public function setLastName(?string $lastName) : self + public function setLastName(?string $lastName): self { $this->lastName = $lastName; + return $this; } + /** * The contact’s email address. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * The contact’s email address. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } + /** * The contact’s office phone number. - * - * @return string|null */ - public function getPhoneOffice() : ?string + public function getPhoneOffice(): ?string { return $this->phoneOffice; } + /** * The contact’s office phone number. - * - * @param string|null $phoneOffice - * - * @return self */ - public function setPhoneOffice(?string $phoneOffice) : self + public function setPhoneOffice(?string $phoneOffice): self { $this->phoneOffice = $phoneOffice; + return $this; } + /** * The contact’s mobile phone number. - * - * @return string|null */ - public function getPhoneMobile() : ?string + public function getPhoneMobile(): ?string { return $this->phoneMobile; } + /** * The contact’s mobile phone number. - * - * @param string|null $phoneMobile - * - * @return self */ - public function setPhoneMobile(?string $phoneMobile) : self + public function setPhoneMobile(?string $phoneMobile): self { $this->phoneMobile = $phoneMobile; + return $this; } + /** * The contact’s fax number. - * - * @return string|null */ - public function getFax() : ?string + public function getFax(): ?string { return $this->fax; } + /** * The contact’s fax number. - * - * @param string|null $fax - * - * @return self */ - public function setFax(?string $fax) : self + public function setFax(?string $fax): self { $this->fax = $fax; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ContactsPostBody.php b/generated/Model/ContactsPostBody.php index 2358645..64051d6 100644 --- a/generated/Model/ContactsPostBody.php +++ b/generated/Model/ContactsPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ContactsPostBody @@ -52,172 +61,148 @@ class ContactsPostBody * @var string|null */ protected $fax; + /** * The ID of the client associated with this contact. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client associated with this contact. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The title of the contact. - * - * @return string|null */ - public function getTitle() : ?string + public function getTitle(): ?string { return $this->title; } + /** * The title of the contact. - * - * @param string|null $title - * - * @return self */ - public function setTitle(?string $title) : self + public function setTitle(?string $title): self { $this->title = $title; + return $this; } + /** * The first name of the contact. - * - * @return string|null */ - public function getFirstName() : ?string + public function getFirstName(): ?string { return $this->firstName; } + /** * The first name of the contact. - * - * @param string|null $firstName - * - * @return self */ - public function setFirstName(?string $firstName) : self + public function setFirstName(?string $firstName): self { $this->firstName = $firstName; + return $this; } + /** * The last name of the contact. - * - * @return string|null */ - public function getLastName() : ?string + public function getLastName(): ?string { return $this->lastName; } + /** * The last name of the contact. - * - * @param string|null $lastName - * - * @return self */ - public function setLastName(?string $lastName) : self + public function setLastName(?string $lastName): self { $this->lastName = $lastName; + return $this; } + /** * The contact’s email address. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * The contact’s email address. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } + /** * The contact’s office phone number. - * - * @return string|null */ - public function getPhoneOffice() : ?string + public function getPhoneOffice(): ?string { return $this->phoneOffice; } + /** * The contact’s office phone number. - * - * @param string|null $phoneOffice - * - * @return self */ - public function setPhoneOffice(?string $phoneOffice) : self + public function setPhoneOffice(?string $phoneOffice): self { $this->phoneOffice = $phoneOffice; + return $this; } + /** * The contact’s mobile phone number. - * - * @return string|null */ - public function getPhoneMobile() : ?string + public function getPhoneMobile(): ?string { return $this->phoneMobile; } + /** * The contact’s mobile phone number. - * - * @param string|null $phoneMobile - * - * @return self */ - public function setPhoneMobile(?string $phoneMobile) : self + public function setPhoneMobile(?string $phoneMobile): self { $this->phoneMobile = $phoneMobile; + return $this; } + /** * The contact’s fax number. - * - * @return string|null */ - public function getFax() : ?string + public function getFax(): ?string { return $this->fax; } + /** * The contact’s fax number. - * - * @param string|null $fax - * - * @return self */ - public function setFax(?string $fax) : self + public function setFax(?string $fax): self { $this->fax = $fax; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/CostRate.php b/generated/Model/CostRate.php index 7ce3d87..56ed7ba 100644 --- a/generated/Model/CostRate.php +++ b/generated/Model/CostRate.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class CostRate @@ -40,130 +49,112 @@ class CostRate * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the cost rate. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the cost rate. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The amount of the cost rate. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The amount of the cost rate. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * The date the cost rate is effective. - * - * @return \DateTime|null */ - public function getStartDate() : ?\DateTime + public function getStartDate(): ?\DateTime { return $this->startDate; } + /** * The date the cost rate is effective. - * - * @param \DateTime|null $startDate - * - * @return self */ - public function setStartDate(?\DateTime $startDate) : self + public function setStartDate(?\DateTime $startDate): self { $this->startDate = $startDate; + return $this; } + /** * The date the cost rate is no longer effective. This date is calculated by Harvest. - * - * @return \DateTime|null */ - public function getEndDate() : ?\DateTime + public function getEndDate(): ?\DateTime { return $this->endDate; } + /** * The date the cost rate is no longer effective. This date is calculated by Harvest. - * - * @param \DateTime|null $endDate - * - * @return self */ - public function setEndDate(?\DateTime $endDate) : self + public function setEndDate(?\DateTime $endDate): self { $this->endDate = $endDate; + return $this; } + /** * Date and time the cost rate was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the cost rate was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the cost rate was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the cost rate was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/CostRates.php b/generated/Model/CostRates.php index 5434155..2e2eb16 100644 --- a/generated/Model/CostRates.php +++ b/generated/Model/CostRates.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class CostRates { /** - * - * * @var CostRate[] */ protected $costRates; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return CostRate[] */ - public function getCostRates() : array + public function getCostRates(): array { return $this->costRates; } + /** - * - * * @param CostRate[] $costRates - * - * @return self */ - public function setCostRates(array $costRates) : self + public function setCostRates(array $costRates): self { $this->costRates = $costRates; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Error.php b/generated/Model/Error.php index ad5a373..d056d18 100644 --- a/generated/Model/Error.php +++ b/generated/Model/Error.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Error { /** - * - * * @var int */ protected $code; /** - * - * * @var string */ protected $message; - /** - * - * - * @return int - */ - public function getCode() : int + + public function getCode(): int { return $this->code; } - /** - * - * - * @param int $code - * - * @return self - */ - public function setCode(int $code) : self + + public function setCode(int $code): self { $this->code = $code; + return $this; } - /** - * - * - * @return string - */ - public function getMessage() : string + + public function getMessage(): string { return $this->message; } - /** - * - * - * @param string $message - * - * @return self - */ - public function setMessage(string $message) : self + + public function setMessage(string $message): self { $this->message = $message; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Estimate.php b/generated/Model/Estimate.php index f4354d2..630da14 100644 --- a/generated/Model/Estimate.php +++ b/generated/Model/Estimate.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Estimate @@ -29,7 +38,7 @@ class Estimate */ protected $creator; /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456 + * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456. * * @var string|null */ @@ -148,508 +157,440 @@ class Estimate * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the estimate. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the estimate. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing estimate’s client id and name. - * - * @return EstimateClient|null */ - public function getClient() : ?EstimateClient + public function getClient(): ?EstimateClient { return $this->client; } + /** * An object containing estimate’s client id and name. - * - * @param EstimateClient|null $client - * - * @return self */ - public function setClient(?EstimateClient $client) : self + public function setClient(?EstimateClient $client): self { $this->client = $client; + return $this; } + /** * Array of estimate line items. * * @return EstimateLineItem[]|null */ - public function getLineItems() : ?array + public function getLineItems(): ?array { return $this->lineItems; } + /** * Array of estimate line items. * * @param EstimateLineItem[]|null $lineItems - * - * @return self */ - public function setLineItems(?array $lineItems) : self + public function setLineItems(?array $lineItems): self { $this->lineItems = $lineItems; + return $this; } + /** * An object containing the id and name of the person that created the estimate. - * - * @return EstimateCreator|null */ - public function getCreator() : ?EstimateCreator + public function getCreator(): ?EstimateCreator { return $this->creator; } + /** * An object containing the id and name of the person that created the estimate. - * - * @param EstimateCreator|null $creator - * - * @return self */ - public function setCreator(?EstimateCreator $creator) : self + public function setCreator(?EstimateCreator $creator): self { $this->creator = $creator; + return $this; } + /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456 - * - * @return string|null + * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456. */ - public function getClientKey() : ?string + public function getClientKey(): ?string { return $this->clientKey; } + /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456 - * - * @param string|null $clientKey - * - * @return self + * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/estimates/abc123456. */ - public function setClientKey(?string $clientKey) : self + public function setClientKey(?string $clientKey): self { $this->clientKey = $clientKey; + return $this; } + /** * If no value is set, the number will be automatically generated. - * - * @return string|null */ - public function getNumber() : ?string + public function getNumber(): ?string { return $this->number; } + /** * If no value is set, the number will be automatically generated. - * - * @param string|null $number - * - * @return self */ - public function setNumber(?string $number) : self + public function setNumber(?string $number): self { $this->number = $number; + return $this; } + /** * The purchase order number. - * - * @return string|null */ - public function getPurchaseOrder() : ?string + public function getPurchaseOrder(): ?string { return $this->purchaseOrder; } + /** * The purchase order number. - * - * @param string|null $purchaseOrder - * - * @return self */ - public function setPurchaseOrder(?string $purchaseOrder) : self + public function setPurchaseOrder(?string $purchaseOrder): self { $this->purchaseOrder = $purchaseOrder; + return $this; } + /** * The total amount for the estimate, including any discounts and taxes. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The total amount for the estimate, including any discounts and taxes. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @return float|null */ - public function getTax() : ?float + public function getTax(): ?float { return $this->tax; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @param float|null $tax - * - * @return self */ - public function setTax(?float $tax) : self + public function setTax(?float $tax): self { $this->tax = $tax; + return $this; } + /** * The first amount of tax included, calculated from tax. If no tax is defined, this value will be null. - * - * @return float|null */ - public function getTaxAmount() : ?float + public function getTaxAmount(): ?float { return $this->taxAmount; } + /** * The first amount of tax included, calculated from tax. If no tax is defined, this value will be null. - * - * @param float|null $taxAmount - * - * @return self */ - public function setTaxAmount(?float $taxAmount) : self + public function setTaxAmount(?float $taxAmount): self { $this->taxAmount = $taxAmount; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @return float|null */ - public function getTax2() : ?float + public function getTax2(): ?float { return $this->tax2; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @param float|null $tax2 - * - * @return self */ - public function setTax2(?float $tax2) : self + public function setTax2(?float $tax2): self { $this->tax2 = $tax2; + return $this; } + /** * The amount calculated from tax2. - * - * @return float|null */ - public function getTax2Amount() : ?float + public function getTax2Amount(): ?float { return $this->tax2Amount; } + /** * The amount calculated from tax2. - * - * @param float|null $tax2Amount - * - * @return self */ - public function setTax2Amount(?float $tax2Amount) : self + public function setTax2Amount(?float $tax2Amount): self { $this->tax2Amount = $tax2Amount; + return $this; } + /** * This percentage is subtracted from the subtotal. - * - * @return float|null */ - public function getDiscount() : ?float + public function getDiscount(): ?float { return $this->discount; } + /** * This percentage is subtracted from the subtotal. - * - * @param float|null $discount - * - * @return self */ - public function setDiscount(?float $discount) : self + public function setDiscount(?float $discount): self { $this->discount = $discount; + return $this; } + /** * The amount calcuated from discount. - * - * @return float|null */ - public function getDiscountAmount() : ?float + public function getDiscountAmount(): ?float { return $this->discountAmount; } + /** * The amount calcuated from discount. - * - * @param float|null $discountAmount - * - * @return self */ - public function setDiscountAmount(?float $discountAmount) : self + public function setDiscountAmount(?float $discountAmount): self { $this->discountAmount = $discountAmount; + return $this; } + /** * The estimate subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The estimate subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * Any additional notes included on the estimate. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any additional notes included on the estimate. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * The currency code associated with this estimate. - * - * @return string|null */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** * The currency code associated with this estimate. - * - * @param string|null $currency - * - * @return self */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * The current state of the estimate: draft, sent, accepted, or declined. - * - * @return string|null */ - public function getState() : ?string + public function getState(): ?string { return $this->state; } + /** * The current state of the estimate: draft, sent, accepted, or declined. - * - * @param string|null $state - * - * @return self */ - public function setState(?string $state) : self + public function setState(?string $state): self { $this->state = $state; + return $this; } + /** * Date the estimate was issued. - * - * @return \DateTime|null */ - public function getIssueDate() : ?\DateTime + public function getIssueDate(): ?\DateTime { return $this->issueDate; } + /** * Date the estimate was issued. - * - * @param \DateTime|null $issueDate - * - * @return self */ - public function setIssueDate(?\DateTime $issueDate) : self + public function setIssueDate(?\DateTime $issueDate): self { $this->issueDate = $issueDate; + return $this; } + /** * Date and time the estimate was sent. - * - * @return \DateTime|null */ - public function getSentAt() : ?\DateTime + public function getSentAt(): ?\DateTime { return $this->sentAt; } + /** * Date and time the estimate was sent. - * - * @param \DateTime|null $sentAt - * - * @return self */ - public function setSentAt(?\DateTime $sentAt) : self + public function setSentAt(?\DateTime $sentAt): self { $this->sentAt = $sentAt; + return $this; } + /** * Date and time the estimate was accepted. - * - * @return \DateTime|null */ - public function getAcceptedAt() : ?\DateTime + public function getAcceptedAt(): ?\DateTime { return $this->acceptedAt; } + /** * Date and time the estimate was accepted. - * - * @param \DateTime|null $acceptedAt - * - * @return self */ - public function setAcceptedAt(?\DateTime $acceptedAt) : self + public function setAcceptedAt(?\DateTime $acceptedAt): self { $this->acceptedAt = $acceptedAt; + return $this; } + /** * Date and time the estimate was declined. - * - * @return \DateTime|null */ - public function getDeclinedAt() : ?\DateTime + public function getDeclinedAt(): ?\DateTime { return $this->declinedAt; } + /** * Date and time the estimate was declined. - * - * @param \DateTime|null $declinedAt - * - * @return self */ - public function setDeclinedAt(?\DateTime $declinedAt) : self + public function setDeclinedAt(?\DateTime $declinedAt): self { $this->declinedAt = $declinedAt; + return $this; } + /** * Date and time the estimate was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the estimate was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the estimate was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the estimate was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateClient.php b/generated/Model/EstimateClient.php index 0665b00..6426984 100644 --- a/generated/Model/EstimateClient.php +++ b/generated/Model/EstimateClient.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateCreator.php b/generated/Model/EstimateCreator.php index 5324002..dca4bd0 100644 --- a/generated/Model/EstimateCreator.php +++ b/generated/Model/EstimateCreator.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateCreator { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateItemCategories.php b/generated/Model/EstimateItemCategories.php index 3f283e6..910624e 100644 --- a/generated/Model/EstimateItemCategories.php +++ b/generated/Model/EstimateItemCategories.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateItemCategories { /** - * - * * @var EstimateItemCategory[] */ protected $estimateItemCategories; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return EstimateItemCategory[] */ - public function getEstimateItemCategories() : array + public function getEstimateItemCategories(): array { return $this->estimateItemCategories; } + /** - * - * * @param EstimateItemCategory[] $estimateItemCategories - * - * @return self */ - public function setEstimateItemCategories(array $estimateItemCategories) : self + public function setEstimateItemCategories(array $estimateItemCategories): self { $this->estimateItemCategories = $estimateItemCategories; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php b/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php index 0402a12..e9288b0 100644 --- a/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php +++ b/generated/Model/EstimateItemCategoriesEstimateItemCategoryIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateItemCategoriesEstimateItemCategoryIdPatchBody @@ -10,25 +19,22 @@ class EstimateItemCategoriesEstimateItemCategoryIdPatchBody * @var string|null */ protected $name; + /** * The name of the estimate item category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the estimate item category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateItemCategoriesPostBody.php b/generated/Model/EstimateItemCategoriesPostBody.php index e80c3e9..18d156c 100644 --- a/generated/Model/EstimateItemCategoriesPostBody.php +++ b/generated/Model/EstimateItemCategoriesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateItemCategoriesPostBody @@ -10,25 +19,22 @@ class EstimateItemCategoriesPostBody * @var string|null */ protected $name; + /** * The name of the estimate item category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the estimate item category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateItemCategory.php b/generated/Model/EstimateItemCategory.php index 3d36241..69865ac 100644 --- a/generated/Model/EstimateItemCategory.php +++ b/generated/Model/EstimateItemCategory.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateItemCategory @@ -28,88 +37,76 @@ class EstimateItemCategory * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the estimate item category. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the estimate item category. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The name of the estimate item category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the estimate item category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Date and time the estimate item category was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the estimate item category was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the estimate item category was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the estimate item category was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateLineItem.php b/generated/Model/EstimateLineItem.php index 13d483c..41990b8 100644 --- a/generated/Model/EstimateLineItem.php +++ b/generated/Model/EstimateLineItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateLineItem @@ -52,172 +61,148 @@ class EstimateLineItem * @var bool|null */ protected $taxed2; + /** * Unique ID for the line item. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the line item. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The name of an estimate item category. - * - * @return string|null */ - public function getKind() : ?string + public function getKind(): ?string { return $this->kind; } + /** * The name of an estimate item category. - * - * @param string|null $kind - * - * @return self */ - public function setKind(?string $kind) : self + public function setKind(?string $kind): self { $this->kind = $kind; + return $this; } + /** * Text description of the line item. - * - * @return string|null */ - public function getDescription() : ?string + public function getDescription(): ?string { return $this->description; } + /** * Text description of the line item. - * - * @param string|null $description - * - * @return self */ - public function setDescription(?string $description) : self + public function setDescription(?string $description): self { $this->description = $description; + return $this; } + /** * The unit quantity of the item. - * - * @return float|null */ - public function getQuantity() : ?float + public function getQuantity(): ?float { return $this->quantity; } + /** * The unit quantity of the item. - * - * @param float|null $quantity - * - * @return self */ - public function setQuantity(?float $quantity) : self + public function setQuantity(?float $quantity): self { $this->quantity = $quantity; + return $this; } + /** * The individual price per unit. - * - * @return float|null */ - public function getUnitPrice() : ?float + public function getUnitPrice(): ?float { return $this->unitPrice; } + /** * The individual price per unit. - * - * @param float|null $unitPrice - * - * @return self */ - public function setUnitPrice(?float $unitPrice) : self + public function setUnitPrice(?float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * The line item subtotal (quantity * unit_price). - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The line item subtotal (quantity * unit_price). - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * Whether the estimate’s tax percentage applies to this line item. - * - * @return bool|null */ - public function getTaxed() : ?bool + public function getTaxed(): ?bool { return $this->taxed; } + /** * Whether the estimate’s tax percentage applies to this line item. - * - * @param bool|null $taxed - * - * @return self */ - public function setTaxed(?bool $taxed) : self + public function setTaxed(?bool $taxed): self { $this->taxed = $taxed; + return $this; } + /** * Whether the estimate’s tax2 percentage applies to this line item. - * - * @return bool|null */ - public function getTaxed2() : ?bool + public function getTaxed2(): ?bool { return $this->taxed2; } + /** * Whether the estimate’s tax2 percentage applies to this line item. - * - * @param bool|null $taxed2 - * - * @return self */ - public function setTaxed2(?bool $taxed2) : self + public function setTaxed2(?bool $taxed2): self { $this->taxed2 = $taxed2; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateLineItems.php b/generated/Model/EstimateLineItems.php index b6738cd..de5cb56 100644 --- a/generated/Model/EstimateLineItems.php +++ b/generated/Model/EstimateLineItems.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateLineItems { /** - * - * * @var EstimateLineItem[] */ protected $estimateLineItems; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return EstimateLineItem[] */ - public function getEstimateLineItems() : array + public function getEstimateLineItems(): array { return $this->estimateLineItems; } + /** - * - * * @param EstimateLineItem[] $estimateLineItems - * - * @return self */ - public function setEstimateLineItems(array $estimateLineItems) : self + public function setEstimateLineItems(array $estimateLineItems): self { $this->estimateLineItems = $estimateLineItems; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateMessage.php b/generated/Model/EstimateMessage.php index 6029b99..51607ee 100644 --- a/generated/Model/EstimateMessage.php +++ b/generated/Model/EstimateMessage.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateMessage @@ -76,256 +85,224 @@ class EstimateMessage * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the message. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the message. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * Name of the user that created the message. - * - * @return string|null */ - public function getSentBy() : ?string + public function getSentBy(): ?string { return $this->sentBy; } + /** * Name of the user that created the message. - * - * @param string|null $sentBy - * - * @return self */ - public function setSentBy(?string $sentBy) : self + public function setSentBy(?string $sentBy): self { $this->sentBy = $sentBy; + return $this; } + /** * Email of the user that created the message. - * - * @return string|null */ - public function getSentByEmail() : ?string + public function getSentByEmail(): ?string { return $this->sentByEmail; } + /** * Email of the user that created the message. - * - * @param string|null $sentByEmail - * - * @return self */ - public function setSentByEmail(?string $sentByEmail) : self + public function setSentByEmail(?string $sentByEmail): self { $this->sentByEmail = $sentByEmail; + return $this; } + /** * Name of the user that the message was sent from. - * - * @return string|null */ - public function getSentFrom() : ?string + public function getSentFrom(): ?string { return $this->sentFrom; } + /** * Name of the user that the message was sent from. - * - * @param string|null $sentFrom - * - * @return self */ - public function setSentFrom(?string $sentFrom) : self + public function setSentFrom(?string $sentFrom): self { $this->sentFrom = $sentFrom; + return $this; } + /** * Email of the user that message was sent from. - * - * @return string|null */ - public function getSentFromEmail() : ?string + public function getSentFromEmail(): ?string { return $this->sentFromEmail; } + /** * Email of the user that message was sent from. - * - * @param string|null $sentFromEmail - * - * @return self */ - public function setSentFromEmail(?string $sentFromEmail) : self + public function setSentFromEmail(?string $sentFromEmail): self { $this->sentFromEmail = $sentFromEmail; + return $this; } + /** * Array of estimate message recipients. * * @return EstimateMessageRecipient[]|null */ - public function getRecipients() : ?array + public function getRecipients(): ?array { return $this->recipients; } + /** * Array of estimate message recipients. * * @param EstimateMessageRecipient[]|null $recipients - * - * @return self */ - public function setRecipients(?array $recipients) : self + public function setRecipients(?array $recipients): self { $this->recipients = $recipients; + return $this; } + /** * The message subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The message subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * The message body. - * - * @return string|null */ - public function getBody() : ?string + public function getBody(): ?string { return $this->body; } + /** * The message body. - * - * @param string|null $body - * - * @return self */ - public function setBody(?string $body) : self + public function setBody(?string $body): self { $this->body = $body; + return $this; } + /** * Whether to email a copy of the message to the current user. - * - * @return bool|null */ - public function getSendMeACopy() : ?bool + public function getSendMeACopy(): ?bool { return $this->sendMeACopy; } + /** * Whether to email a copy of the message to the current user. - * - * @param bool|null $sendMeACopy - * - * @return self */ - public function setSendMeACopy(?bool $sendMeACopy) : self + public function setSendMeACopy(?bool $sendMeACopy): self { $this->sendMeACopy = $sendMeACopy; + return $this; } + /** * The type of estimate event that occurred with the message: send, accept, decline, re-open, view, or invoice. - * - * @return string|null */ - public function getEventType() : ?string + public function getEventType(): ?string { return $this->eventType; } + /** * The type of estimate event that occurred with the message: send, accept, decline, re-open, view, or invoice. - * - * @param string|null $eventType - * - * @return self */ - public function setEventType(?string $eventType) : self + public function setEventType(?string $eventType): self { $this->eventType = $eventType; + return $this; } + /** * Date and time the message was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the message was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the message was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the message was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateMessageRecipient.php b/generated/Model/EstimateMessageRecipient.php index 74989fb..aec372b 100644 --- a/generated/Model/EstimateMessageRecipient.php +++ b/generated/Model/EstimateMessageRecipient.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateMessageRecipient @@ -16,46 +25,40 @@ class EstimateMessageRecipient * @var string|null */ protected $email; + /** * Name of the message recipient. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * Name of the message recipient. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Email of the message recipient. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * Email of the message recipient. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateMessageRecipients.php b/generated/Model/EstimateMessageRecipients.php index 43a6399..9b71a06 100644 --- a/generated/Model/EstimateMessageRecipients.php +++ b/generated/Model/EstimateMessageRecipients.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateMessageRecipients { /** - * - * * @var EstimateMessageRecipient[] */ protected $estimateMessageRecipients; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return EstimateMessageRecipient[] */ - public function getEstimateMessageRecipients() : array + public function getEstimateMessageRecipients(): array { return $this->estimateMessageRecipients; } + /** - * - * * @param EstimateMessageRecipient[] $estimateMessageRecipients - * - * @return self */ - public function setEstimateMessageRecipients(array $estimateMessageRecipients) : self + public function setEstimateMessageRecipients(array $estimateMessageRecipients): self { $this->estimateMessageRecipients = $estimateMessageRecipients; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimateMessages.php b/generated/Model/EstimateMessages.php index d92224d..489bd16 100644 --- a/generated/Model/EstimateMessages.php +++ b/generated/Model/EstimateMessages.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimateMessages { /** - * - * * @var EstimateMessage[] */ protected $estimateMessages; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return EstimateMessage[] */ - public function getEstimateMessages() : array + public function getEstimateMessages(): array { return $this->estimateMessages; } + /** - * - * * @param EstimateMessage[] $estimateMessages - * - * @return self */ - public function setEstimateMessages(array $estimateMessages) : self + public function setEstimateMessages(array $estimateMessages): self { $this->estimateMessages = $estimateMessages; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Estimates.php b/generated/Model/Estimates.php index e1d8507..28188d7 100644 --- a/generated/Model/Estimates.php +++ b/generated/Model/Estimates.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Estimates { /** - * - * * @var Estimate[] */ protected $estimates; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Estimate[] */ - public function getEstimates() : array + public function getEstimates(): array { return $this->estimates; } + /** - * - * * @param Estimate[] $estimates - * - * @return self */ - public function setEstimates(array $estimates) : self + public function setEstimates(array $estimates): self { $this->estimates = $estimates; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimatesEstimateIdMessagesPostBody.php b/generated/Model/EstimatesEstimateIdMessagesPostBody.php index dbc27ea..14d178a 100644 --- a/generated/Model/EstimatesEstimateIdMessagesPostBody.php +++ b/generated/Model/EstimatesEstimateIdMessagesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimatesEstimateIdMessagesPostBody @@ -34,109 +43,98 @@ class EstimatesEstimateIdMessagesPostBody * @var bool|null */ protected $sendMeACopy; + /** * If provided, runs an event against the estimate. Options: “accept”, “decline”, “re-open”, or “send”. - * - * @return string|null */ - public function getEventType() : ?string + public function getEventType(): ?string { return $this->eventType; } + /** * If provided, runs an event against the estimate. Options: “accept”, “decline”, “re-open”, or “send”. - * - * @param string|null $eventType - * - * @return self */ - public function setEventType(?string $eventType) : self + public function setEventType(?string $eventType): self { $this->eventType = $eventType; + return $this; } + /** * Array of recipient parameters. See below for details. * * @return EstimatesEstimateIdMessagesPostBodyRecipientsItem[]|null */ - public function getRecipients() : ?array + public function getRecipients(): ?array { return $this->recipients; } + /** * Array of recipient parameters. See below for details. * * @param EstimatesEstimateIdMessagesPostBodyRecipientsItem[]|null $recipients - * - * @return self */ - public function setRecipients(?array $recipients) : self + public function setRecipients(?array $recipients): self { $this->recipients = $recipients; + return $this; } + /** * The message subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The message subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * The message body. - * - * @return string|null */ - public function getBody() : ?string + public function getBody(): ?string { return $this->body; } + /** * The message body. - * - * @param string|null $body - * - * @return self */ - public function setBody(?string $body) : self + public function setBody(?string $body): self { $this->body = $body; + return $this; } + /** * If set to true, a copy of the message email will be sent to the current user. Defaults to false. - * - * @return bool|null */ - public function getSendMeACopy() : ?bool + public function getSendMeACopy(): ?bool { return $this->sendMeACopy; } + /** * If set to true, a copy of the message email will be sent to the current user. Defaults to false. - * - * @param bool|null $sendMeACopy - * - * @return self */ - public function setSendMeACopy(?bool $sendMeACopy) : self + public function setSendMeACopy(?bool $sendMeACopy): self { $this->sendMeACopy = $sendMeACopy; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php b/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php index e4ea349..88a3039 100644 --- a/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php +++ b/generated/Model/EstimatesEstimateIdMessagesPostBodyRecipientsItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimatesEstimateIdMessagesPostBodyRecipientsItem @@ -16,46 +25,40 @@ class EstimatesEstimateIdMessagesPostBodyRecipientsItem * @var string */ protected $email; + /** * Name of the message recipient. - * - * @return string */ - public function getName() : string + public function getName(): string { return $this->name; } + /** * Name of the message recipient. - * - * @param string $name - * - * @return self */ - public function setName(string $name) : self + public function setName(string $name): self { $this->name = $name; + return $this; } + /** * Email of the message recipient. - * - * @return string */ - public function getEmail() : string + public function getEmail(): string { return $this->email; } + /** * Email of the message recipient. - * - * @param string $email - * - * @return self */ - public function setEmail(string $email) : self + public function setEmail(string $email): self { $this->email = $email; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimatesEstimateIdPatchBody.php b/generated/Model/EstimatesEstimateIdPatchBody.php index 9c8cf2a..607bf41 100644 --- a/generated/Model/EstimatesEstimateIdPatchBody.php +++ b/generated/Model/EstimatesEstimateIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimatesEstimateIdPatchBody @@ -53,7 +62,7 @@ class EstimatesEstimateIdPatchBody */ protected $notes; /** - * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies + * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies. * * @var string|null */ @@ -65,240 +74,211 @@ class EstimatesEstimateIdPatchBody */ protected $issueDate; /** - * Array of line item parameters + * Array of line item parameters. * * @var EstimatesEstimateIdPatchBodyLineItemsItem[]|null */ protected $lineItems; + /** * The ID of the client this estimate belongs to. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client this estimate belongs to. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * If no value is set, the number will be automatically generated. - * - * @return string|null */ - public function getNumber() : ?string + public function getNumber(): ?string { return $this->number; } + /** * If no value is set, the number will be automatically generated. - * - * @param string|null $number - * - * @return self */ - public function setNumber(?string $number) : self + public function setNumber(?string $number): self { $this->number = $number; + return $this; } + /** * The purchase order number. - * - * @return string|null */ - public function getPurchaseOrder() : ?string + public function getPurchaseOrder(): ?string { return $this->purchaseOrder; } + /** * The purchase order number. - * - * @param string|null $purchaseOrder - * - * @return self */ - public function setPurchaseOrder(?string $purchaseOrder) : self + public function setPurchaseOrder(?string $purchaseOrder): self { $this->purchaseOrder = $purchaseOrder; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax() : ?float + public function getTax(): ?float { return $this->tax; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax - * - * @return self */ - public function setTax(?float $tax) : self + public function setTax(?float $tax): self { $this->tax = $tax; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax2() : ?float + public function getTax2(): ?float { return $this->tax2; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax2 - * - * @return self */ - public function setTax2(?float $tax2) : self + public function setTax2(?float $tax2): self { $this->tax2 = $tax2; + return $this; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getDiscount() : ?float + public function getDiscount(): ?float { return $this->discount; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @param float|null $discount - * - * @return self */ - public function setDiscount(?float $discount) : self + public function setDiscount(?float $discount): self { $this->discount = $discount; + return $this; } + /** * The estimate subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The estimate subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * Any additional notes to include on the estimate. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any additional notes to include on the estimate. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** - * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @return string|null + * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** - * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @param string|null $currency - * - * @return self + * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * Date the estimate was issued. - * - * @return \DateTime|null */ - public function getIssueDate() : ?\DateTime + public function getIssueDate(): ?\DateTime { return $this->issueDate; } + /** * Date the estimate was issued. - * - * @param \DateTime|null $issueDate - * - * @return self */ - public function setIssueDate(?\DateTime $issueDate) : self + public function setIssueDate(?\DateTime $issueDate): self { $this->issueDate = $issueDate; + return $this; } + /** - * Array of line item parameters + * Array of line item parameters. * * @return EstimatesEstimateIdPatchBodyLineItemsItem[]|null */ - public function getLineItems() : ?array + public function getLineItems(): ?array { return $this->lineItems; } + /** - * Array of line item parameters + * Array of line item parameters. * * @param EstimatesEstimateIdPatchBodyLineItemsItem[]|null $lineItems - * - * @return self */ - public function setLineItems(?array $lineItems) : self + public function setLineItems(?array $lineItems): self { $this->lineItems = $lineItems; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php b/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php index da4e617..6e728d3 100644 --- a/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php +++ b/generated/Model/EstimatesEstimateIdPatchBodyLineItemsItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimatesEstimateIdPatchBodyLineItemsItem @@ -46,151 +55,130 @@ class EstimatesEstimateIdPatchBodyLineItemsItem * @var bool */ protected $taxed2; + /** * Unique ID for the line item. - * - * @return int */ - public function getId() : int + public function getId(): int { return $this->id; } + /** * Unique ID for the line item. - * - * @param int $id - * - * @return self */ - public function setId(int $id) : self + public function setId(int $id): self { $this->id = $id; + return $this; } + /** * The name of an estimate item category. - * - * @return string */ - public function getKind() : string + public function getKind(): string { return $this->kind; } + /** * The name of an estimate item category. - * - * @param string $kind - * - * @return self */ - public function setKind(string $kind) : self + public function setKind(string $kind): self { $this->kind = $kind; + return $this; } + /** * Text description of the line item. - * - * @return string */ - public function getDescription() : string + public function getDescription(): string { return $this->description; } + /** * Text description of the line item. - * - * @param string $description - * - * @return self */ - public function setDescription(string $description) : self + public function setDescription(string $description): self { $this->description = $description; + return $this; } + /** * The unit quantity of the item. Defaults to 1. - * - * @return int */ - public function getQuantity() : int + public function getQuantity(): int { return $this->quantity; } + /** * The unit quantity of the item. Defaults to 1. - * - * @param int $quantity - * - * @return self */ - public function setQuantity(int $quantity) : self + public function setQuantity(int $quantity): self { $this->quantity = $quantity; + return $this; } + /** * The individual price per unit. - * - * @return float */ - public function getUnitPrice() : float + public function getUnitPrice(): float { return $this->unitPrice; } + /** * The individual price per unit. - * - * @param float $unitPrice - * - * @return self */ - public function setUnitPrice(float $unitPrice) : self + public function setUnitPrice(float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the estimate’s tax percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed() : bool + public function getTaxed(): bool { return $this->taxed; } + /** * Whether the estimate’s tax percentage applies to this line item. Defaults to false. - * - * @param bool $taxed - * - * @return self */ - public function setTaxed(bool $taxed) : self + public function setTaxed(bool $taxed): self { $this->taxed = $taxed; + return $this; } + /** * Whether the estimate’s tax2 percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed2() : bool + public function getTaxed2(): bool { return $this->taxed2; } + /** * Whether the estimate’s tax2 percentage applies to this line item. Defaults to false. - * - * @param bool $taxed2 - * - * @return self */ - public function setTaxed2(bool $taxed2) : self + public function setTaxed2(bool $taxed2): self { $this->taxed2 = $taxed2; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimatesPostBody.php b/generated/Model/EstimatesPostBody.php index ea72c63..685713d 100644 --- a/generated/Model/EstimatesPostBody.php +++ b/generated/Model/EstimatesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimatesPostBody @@ -53,7 +62,7 @@ class EstimatesPostBody */ protected $notes; /** - * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies + * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies. * * @var string|null */ @@ -65,240 +74,211 @@ class EstimatesPostBody */ protected $issueDate; /** - * Array of line item parameters + * Array of line item parameters. * * @var EstimatesPostBodyLineItemsItem[]|null */ protected $lineItems; + /** * The ID of the client this estimate belongs to. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client this estimate belongs to. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * If no value is set, the number will be automatically generated. - * - * @return string|null */ - public function getNumber() : ?string + public function getNumber(): ?string { return $this->number; } + /** * If no value is set, the number will be automatically generated. - * - * @param string|null $number - * - * @return self */ - public function setNumber(?string $number) : self + public function setNumber(?string $number): self { $this->number = $number; + return $this; } + /** * The purchase order number. - * - * @return string|null */ - public function getPurchaseOrder() : ?string + public function getPurchaseOrder(): ?string { return $this->purchaseOrder; } + /** * The purchase order number. - * - * @param string|null $purchaseOrder - * - * @return self */ - public function setPurchaseOrder(?string $purchaseOrder) : self + public function setPurchaseOrder(?string $purchaseOrder): self { $this->purchaseOrder = $purchaseOrder; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax() : ?float + public function getTax(): ?float { return $this->tax; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax - * - * @return self */ - public function setTax(?float $tax) : self + public function setTax(?float $tax): self { $this->tax = $tax; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax2() : ?float + public function getTax2(): ?float { return $this->tax2; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax2 - * - * @return self */ - public function setTax2(?float $tax2) : self + public function setTax2(?float $tax2): self { $this->tax2 = $tax2; + return $this; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getDiscount() : ?float + public function getDiscount(): ?float { return $this->discount; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @param float|null $discount - * - * @return self */ - public function setDiscount(?float $discount) : self + public function setDiscount(?float $discount): self { $this->discount = $discount; + return $this; } + /** * The estimate subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The estimate subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * Any additional notes to include on the estimate. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any additional notes to include on the estimate. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** - * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @return string|null + * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** - * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @param string|null $currency - * - * @return self + * The currency used by the estimate. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * Date the estimate was issued. Defaults to today’s date. - * - * @return \DateTime|null */ - public function getIssueDate() : ?\DateTime + public function getIssueDate(): ?\DateTime { return $this->issueDate; } + /** * Date the estimate was issued. Defaults to today’s date. - * - * @param \DateTime|null $issueDate - * - * @return self */ - public function setIssueDate(?\DateTime $issueDate) : self + public function setIssueDate(?\DateTime $issueDate): self { $this->issueDate = $issueDate; + return $this; } + /** - * Array of line item parameters + * Array of line item parameters. * * @return EstimatesPostBodyLineItemsItem[]|null */ - public function getLineItems() : ?array + public function getLineItems(): ?array { return $this->lineItems; } + /** - * Array of line item parameters + * Array of line item parameters. * * @param EstimatesPostBodyLineItemsItem[]|null $lineItems - * - * @return self */ - public function setLineItems(?array $lineItems) : self + public function setLineItems(?array $lineItems): self { $this->lineItems = $lineItems; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/EstimatesPostBodyLineItemsItem.php b/generated/Model/EstimatesPostBodyLineItemsItem.php index 395b1a3..baa3407 100644 --- a/generated/Model/EstimatesPostBodyLineItemsItem.php +++ b/generated/Model/EstimatesPostBodyLineItemsItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class EstimatesPostBodyLineItemsItem @@ -40,130 +49,112 @@ class EstimatesPostBodyLineItemsItem * @var bool */ protected $taxed2; + /** * The name of an estimate item category. - * - * @return string */ - public function getKind() : string + public function getKind(): string { return $this->kind; } + /** * The name of an estimate item category. - * - * @param string $kind - * - * @return self */ - public function setKind(string $kind) : self + public function setKind(string $kind): self { $this->kind = $kind; + return $this; } + /** * Text description of the line item. - * - * @return string */ - public function getDescription() : string + public function getDescription(): string { return $this->description; } + /** * Text description of the line item. - * - * @param string $description - * - * @return self */ - public function setDescription(string $description) : self + public function setDescription(string $description): self { $this->description = $description; + return $this; } + /** * The unit quantity of the item. Defaults to 1. - * - * @return int */ - public function getQuantity() : int + public function getQuantity(): int { return $this->quantity; } + /** * The unit quantity of the item. Defaults to 1. - * - * @param int $quantity - * - * @return self */ - public function setQuantity(int $quantity) : self + public function setQuantity(int $quantity): self { $this->quantity = $quantity; + return $this; } + /** * The individual price per unit. - * - * @return float */ - public function getUnitPrice() : float + public function getUnitPrice(): float { return $this->unitPrice; } + /** * The individual price per unit. - * - * @param float $unitPrice - * - * @return self */ - public function setUnitPrice(float $unitPrice) : self + public function setUnitPrice(float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the estimate’s tax percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed() : bool + public function getTaxed(): bool { return $this->taxed; } + /** * Whether the estimate’s tax percentage applies to this line item. Defaults to false. - * - * @param bool $taxed - * - * @return self */ - public function setTaxed(bool $taxed) : self + public function setTaxed(bool $taxed): self { $this->taxed = $taxed; + return $this; } + /** * Whether the estimate’s tax2 percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed2() : bool + public function getTaxed2(): bool { return $this->taxed2; } + /** * Whether the estimate’s tax2 percentage applies to this line item. Defaults to false. - * - * @param bool $taxed2 - * - * @return self */ - public function setTaxed2(bool $taxed2) : self + public function setTaxed2(bool $taxed2): self { $this->taxed2 = $taxed2; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Expense.php b/generated/Model/Expense.php index 8c5db5b..72da933 100644 --- a/generated/Model/Expense.php +++ b/generated/Model/Expense.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Expense @@ -35,8 +44,6 @@ class Expense */ protected $user; /** - * - * * @var UserAssignment */ protected $userAssignment; @@ -118,403 +125,340 @@ class Expense * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the expense. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the expense. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing the expense’s client id, name, and currency. - * - * @return ExpenseClient|null */ - public function getClient() : ?ExpenseClient + public function getClient(): ?ExpenseClient { return $this->client; } + /** * An object containing the expense’s client id, name, and currency. - * - * @param ExpenseClient|null $client - * - * @return self */ - public function setClient(?ExpenseClient $client) : self + public function setClient(?ExpenseClient $client): self { $this->client = $client; + return $this; } + /** * An object containing the expense’s project id, name, and code. - * - * @return ExpenseProject|null */ - public function getProject() : ?ExpenseProject + public function getProject(): ?ExpenseProject { return $this->project; } + /** * An object containing the expense’s project id, name, and code. - * - * @param ExpenseProject|null $project - * - * @return self */ - public function setProject(?ExpenseProject $project) : self + public function setProject(?ExpenseProject $project): self { $this->project = $project; + return $this; } + /** * An object containing the expense’s expense category id, name, unit_price, and unit_name. - * - * @return ExpenseExpenseCategory|null */ - public function getExpenseCategory() : ?ExpenseExpenseCategory + public function getExpenseCategory(): ?ExpenseExpenseCategory { return $this->expenseCategory; } + /** * An object containing the expense’s expense category id, name, unit_price, and unit_name. - * - * @param ExpenseExpenseCategory|null $expenseCategory - * - * @return self */ - public function setExpenseCategory(?ExpenseExpenseCategory $expenseCategory) : self + public function setExpenseCategory(?ExpenseExpenseCategory $expenseCategory): self { $this->expenseCategory = $expenseCategory; + return $this; } + /** * An object containing the id and name of the user that recorded the expense. - * - * @return ExpenseUser|null */ - public function getUser() : ?ExpenseUser + public function getUser(): ?ExpenseUser { return $this->user; } + /** * An object containing the id and name of the user that recorded the expense. - * - * @param ExpenseUser|null $user - * - * @return self */ - public function setUser(?ExpenseUser $user) : self + public function setUser(?ExpenseUser $user): self { $this->user = $user; + return $this; } - /** - * - * - * @return UserAssignment - */ - public function getUserAssignment() : UserAssignment + + public function getUserAssignment(): UserAssignment { return $this->userAssignment; } - /** - * - * - * @param UserAssignment $userAssignment - * - * @return self - */ - public function setUserAssignment(UserAssignment $userAssignment) : self + + public function setUserAssignment(UserAssignment $userAssignment): self { $this->userAssignment = $userAssignment; + return $this; } + /** * An object containing the expense’s receipt URL and file name. - * - * @return ExpenseReceipt|null */ - public function getReceipt() : ?ExpenseReceipt + public function getReceipt(): ?ExpenseReceipt { return $this->receipt; } + /** * An object containing the expense’s receipt URL and file name. - * - * @param ExpenseReceipt|null $receipt - * - * @return self */ - public function setReceipt(?ExpenseReceipt $receipt) : self + public function setReceipt(?ExpenseReceipt $receipt): self { $this->receipt = $receipt; + return $this; } + /** * Once the expense has been invoiced, this field will include the associated invoice’s id and number. - * - * @return ExpenseInvoice|null */ - public function getInvoice() : ?ExpenseInvoice + public function getInvoice(): ?ExpenseInvoice { return $this->invoice; } + /** * Once the expense has been invoiced, this field will include the associated invoice’s id and number. - * - * @param ExpenseInvoice|null $invoice - * - * @return self */ - public function setInvoice(?ExpenseInvoice $invoice) : self + public function setInvoice(?ExpenseInvoice $invoice): self { $this->invoice = $invoice; + return $this; } + /** * Textual notes used to describe the expense. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Textual notes used to describe the expense. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * The quantity of units used to calculate the total_cost of the expense. - * - * @return int|null */ - public function getUnits() : ?int + public function getUnits(): ?int { return $this->units; } + /** * The quantity of units used to calculate the total_cost of the expense. - * - * @param int|null $units - * - * @return self */ - public function setUnits(?int $units) : self + public function setUnits(?int $units): self { $this->units = $units; + return $this; } + /** * The total amount of the expense. - * - * @return float|null */ - public function getTotalCost() : ?float + public function getTotalCost(): ?float { return $this->totalCost; } + /** * The total amount of the expense. - * - * @param float|null $totalCost - * - * @return self */ - public function setTotalCost(?float $totalCost) : self + public function setTotalCost(?float $totalCost): self { $this->totalCost = $totalCost; + return $this; } + /** * Whether the expense is billable or not. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether the expense is billable or not. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * Whether the expense has been approved or closed for some other reason. - * - * @return bool|null */ - public function getIsClosed() : ?bool + public function getIsClosed(): ?bool { return $this->isClosed; } + /** * Whether the expense has been approved or closed for some other reason. - * - * @param bool|null $isClosed - * - * @return self */ - public function setIsClosed(?bool $isClosed) : self + public function setIsClosed(?bool $isClosed): self { $this->isClosed = $isClosed; + return $this; } + /** * Whether the expense has been been invoiced, approved, or the project or person related to the expense is archived. - * - * @return bool|null */ - public function getIsLocked() : ?bool + public function getIsLocked(): ?bool { return $this->isLocked; } + /** * Whether the expense has been been invoiced, approved, or the project or person related to the expense is archived. - * - * @param bool|null $isLocked - * - * @return self */ - public function setIsLocked(?bool $isLocked) : self + public function setIsLocked(?bool $isLocked): self { $this->isLocked = $isLocked; + return $this; } + /** * Whether or not the expense has been marked as invoiced. - * - * @return bool|null */ - public function getIsBilled() : ?bool + public function getIsBilled(): ?bool { return $this->isBilled; } + /** * Whether or not the expense has been marked as invoiced. - * - * @param bool|null $isBilled - * - * @return self */ - public function setIsBilled(?bool $isBilled) : self + public function setIsBilled(?bool $isBilled): self { $this->isBilled = $isBilled; + return $this; } + /** * An explanation of why the expense has been locked. - * - * @return string|null */ - public function getLockedReason() : ?string + public function getLockedReason(): ?string { return $this->lockedReason; } + /** * An explanation of why the expense has been locked. - * - * @param string|null $lockedReason - * - * @return self */ - public function setLockedReason(?string $lockedReason) : self + public function setLockedReason(?string $lockedReason): self { $this->lockedReason = $lockedReason; + return $this; } + /** * Date the expense occurred. - * - * @return \DateTime|null */ - public function getSpentDate() : ?\DateTime + public function getSpentDate(): ?\DateTime { return $this->spentDate; } + /** * Date the expense occurred. - * - * @param \DateTime|null $spentDate - * - * @return self */ - public function setSpentDate(?\DateTime $spentDate) : self + public function setSpentDate(?\DateTime $spentDate): self { $this->spentDate = $spentDate; + return $this; } + /** * Date and time the expense was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the expense was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the expense was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the expense was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseCategories.php b/generated/Model/ExpenseCategories.php index cb31a2b..56370ed 100644 --- a/generated/Model/ExpenseCategories.php +++ b/generated/Model/ExpenseCategories.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseCategories { /** - * - * * @var ExpenseCategory[] */ protected $expenseCategories; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return ExpenseCategory[] */ - public function getExpenseCategories() : array + public function getExpenseCategories(): array { return $this->expenseCategories; } + /** - * - * * @param ExpenseCategory[] $expenseCategories - * - * @return self */ - public function setExpenseCategories(array $expenseCategories) : self + public function setExpenseCategories(array $expenseCategories): self { $this->expenseCategories = $expenseCategories; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php b/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php index 8f3893e..4481f54 100644 --- a/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php +++ b/generated/Model/ExpenseCategoriesExpenseCategoryIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseCategoriesExpenseCategoryIdPatchBody @@ -28,88 +37,76 @@ class ExpenseCategoriesExpenseCategoryIdPatchBody * @var bool|null */ protected $isActive; + /** * The name of the expense category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the expense category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The unit name of the expense category. - * - * @return string|null */ - public function getUnitName() : ?string + public function getUnitName(): ?string { return $this->unitName; } + /** * The unit name of the expense category. - * - * @param string|null $unitName - * - * @return self */ - public function setUnitName(?string $unitName) : self + public function setUnitName(?string $unitName): self { $this->unitName = $unitName; + return $this; } + /** * The unit price of the expense category. - * - * @return float|null */ - public function getUnitPrice() : ?float + public function getUnitPrice(): ?float { return $this->unitPrice; } + /** * The unit price of the expense category. - * - * @param float|null $unitPrice - * - * @return self */ - public function setUnitPrice(?float $unitPrice) : self + public function setUnitPrice(?float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the expense category is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the expense category is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseCategoriesPostBody.php b/generated/Model/ExpenseCategoriesPostBody.php index 03ca1a8..387ddbc 100644 --- a/generated/Model/ExpenseCategoriesPostBody.php +++ b/generated/Model/ExpenseCategoriesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseCategoriesPostBody @@ -28,88 +37,76 @@ class ExpenseCategoriesPostBody * @var bool|null */ protected $isActive; + /** * The name of the expense category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the expense category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The unit name of the expense category. - * - * @return string|null */ - public function getUnitName() : ?string + public function getUnitName(): ?string { return $this->unitName; } + /** * The unit name of the expense category. - * - * @param string|null $unitName - * - * @return self */ - public function setUnitName(?string $unitName) : self + public function setUnitName(?string $unitName): self { $this->unitName = $unitName; + return $this; } + /** * The unit price of the expense category. - * - * @return float|null */ - public function getUnitPrice() : ?float + public function getUnitPrice(): ?float { return $this->unitPrice; } + /** * The unit price of the expense category. - * - * @param float|null $unitPrice - * - * @return self */ - public function setUnitPrice(?float $unitPrice) : self + public function setUnitPrice(?float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the expense category is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the expense category is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseCategory.php b/generated/Model/ExpenseCategory.php index 9b3df81..d3f0a10 100644 --- a/generated/Model/ExpenseCategory.php +++ b/generated/Model/ExpenseCategory.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseCategory @@ -46,151 +55,130 @@ class ExpenseCategory * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the expense category. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the expense category. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The name of the expense category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the expense category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The unit name of the expense category. - * - * @return string|null */ - public function getUnitName() : ?string + public function getUnitName(): ?string { return $this->unitName; } + /** * The unit name of the expense category. - * - * @param string|null $unitName - * - * @return self */ - public function setUnitName(?string $unitName) : self + public function setUnitName(?string $unitName): self { $this->unitName = $unitName; + return $this; } + /** * The unit price of the expense category. - * - * @return float|null */ - public function getUnitPrice() : ?float + public function getUnitPrice(): ?float { return $this->unitPrice; } + /** * The unit price of the expense category. - * - * @param float|null $unitPrice - * - * @return self */ - public function setUnitPrice(?float $unitPrice) : self + public function setUnitPrice(?float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the expense category is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the expense category is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Date and time the expense category was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the expense category was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the expense category was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the expense category was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseClient.php b/generated/Model/ExpenseClient.php index 85faefb..bfdbe46 100644 --- a/generated/Model/ExpenseClient.php +++ b/generated/Model/ExpenseClient.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $currency; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCurrency() : ?string + + public function getCurrency(): ?string { return $this->currency; } - /** - * - * - * @param string|null $currency - * - * @return self - */ - public function setCurrency(?string $currency) : self + + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseExpenseCategory.php b/generated/Model/ExpenseExpenseCategory.php index 00d1c6f..44cc202 100644 --- a/generated/Model/ExpenseExpenseCategory.php +++ b/generated/Model/ExpenseExpenseCategory.php @@ -1,115 +1,80 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseExpenseCategory { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $unitPrice; /** - * - * * @var string|null */ protected $unitName; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getUnitPrice() : ?string + + public function getUnitPrice(): ?string { return $this->unitPrice; } - /** - * - * - * @param string|null $unitPrice - * - * @return self - */ - public function setUnitPrice(?string $unitPrice) : self + + public function setUnitPrice(?string $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } - /** - * - * - * @return string|null - */ - public function getUnitName() : ?string + + public function getUnitName(): ?string { return $this->unitName; } - /** - * - * - * @param string|null $unitName - * - * @return self - */ - public function setUnitName(?string $unitName) : self + + public function setUnitName(?string $unitName): self { $this->unitName = $unitName; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseInvoice.php b/generated/Model/ExpenseInvoice.php index 8a39c73..9a8e3c7 100644 --- a/generated/Model/ExpenseInvoice.php +++ b/generated/Model/ExpenseInvoice.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseInvoice { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $number; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getNumber() : ?string + + public function getNumber(): ?string { return $this->number; } - /** - * - * - * @param string|null $number - * - * @return self - */ - public function setNumber(?string $number) : self + + public function setNumber(?string $number): self { $this->number = $number; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseProject.php b/generated/Model/ExpenseProject.php index 66064f5..2249695 100644 --- a/generated/Model/ExpenseProject.php +++ b/generated/Model/ExpenseProject.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseProject { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $code; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCode() : ?string + + public function getCode(): ?string { return $this->code; } - /** - * - * - * @param string|null $code - * - * @return self - */ - public function setCode(?string $code) : self + + public function setCode(?string $code): self { $this->code = $code; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseReceipt.php b/generated/Model/ExpenseReceipt.php index 3c5f4cd..7f0e8e4 100644 --- a/generated/Model/ExpenseReceipt.php +++ b/generated/Model/ExpenseReceipt.php @@ -1,115 +1,80 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseReceipt { /** - * - * * @var string|null */ protected $url; /** - * - * * @var string|null */ protected $fileName; /** - * - * * @var int|null */ protected $fileSize; /** - * - * * @var string|null */ protected $contentType; - /** - * - * - * @return string|null - */ - public function getUrl() : ?string + + public function getUrl(): ?string { return $this->url; } - /** - * - * - * @param string|null $url - * - * @return self - */ - public function setUrl(?string $url) : self + + public function setUrl(?string $url): self { $this->url = $url; + return $this; } - /** - * - * - * @return string|null - */ - public function getFileName() : ?string + + public function getFileName(): ?string { return $this->fileName; } - /** - * - * - * @param string|null $fileName - * - * @return self - */ - public function setFileName(?string $fileName) : self + + public function setFileName(?string $fileName): self { $this->fileName = $fileName; + return $this; } - /** - * - * - * @return int|null - */ - public function getFileSize() : ?int + + public function getFileSize(): ?int { return $this->fileSize; } - /** - * - * - * @param int|null $fileSize - * - * @return self - */ - public function setFileSize(?int $fileSize) : self + + public function setFileSize(?int $fileSize): self { $this->fileSize = $fileSize; + return $this; } - /** - * - * - * @return string|null - */ - public function getContentType() : ?string + + public function getContentType(): ?string { return $this->contentType; } - /** - * - * - * @param string|null $contentType - * - * @return self - */ - public function setContentType(?string $contentType) : self + + public function setContentType(?string $contentType): self { $this->contentType = $contentType; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseReportsResult.php b/generated/Model/ExpenseReportsResult.php index a020963..5754d84 100644 --- a/generated/Model/ExpenseReportsResult.php +++ b/generated/Model/ExpenseReportsResult.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseReportsResult @@ -76,256 +85,220 @@ class ExpenseReportsResult * @var string|null */ protected $currency; + /** * The ID of the client associated with the reported expenses. Only returned in the Client and Project reports. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client associated with the reported expenses. Only returned in the Client and Project reports. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The name of the client associated with the reported expenses. Only returned in the Client and Project reports. - * - * @return string|null */ - public function getClientName() : ?string + public function getClientName(): ?string { return $this->clientName; } + /** * The name of the client associated with the reported expenses. Only returned in the Client and Project reports. - * - * @param string|null $clientName - * - * @return self */ - public function setClientName(?string $clientName) : self + public function setClientName(?string $clientName): self { $this->clientName = $clientName; + return $this; } + /** * The ID of the project associated with the reported expenses. Only returned in the Client and Project reports. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project associated with the reported expenses. Only returned in the Client and Project reports. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The name of the project associated with the reported expenses. Only returned in the Client and Project reports. - * - * @return string|null */ - public function getProjectName() : ?string + public function getProjectName(): ?string { return $this->projectName; } + /** * The name of the project associated with the reported expenses. Only returned in the Client and Project reports. - * - * @param string|null $projectName - * - * @return self */ - public function setProjectName(?string $projectName) : self + public function setProjectName(?string $projectName): self { $this->projectName = $projectName; + return $this; } + /** * The ID of the expense category associated with the reported expenses. Only returned in the Expense Category report. - * - * @return int|null */ - public function getExpenseCategoryId() : ?int + public function getExpenseCategoryId(): ?int { return $this->expenseCategoryId; } + /** * The ID of the expense category associated with the reported expenses. Only returned in the Expense Category report. - * - * @param int|null $expenseCategoryId - * - * @return self */ - public function setExpenseCategoryId(?int $expenseCategoryId) : self + public function setExpenseCategoryId(?int $expenseCategoryId): self { $this->expenseCategoryId = $expenseCategoryId; + return $this; } + /** * The name of the expense category associated with the reported expenses. Only returned in the Expense Category report. - * - * @return string|null */ - public function getExpenseCategoryName() : ?string + public function getExpenseCategoryName(): ?string { return $this->expenseCategoryName; } + /** * The name of the expense category associated with the reported expenses. Only returned in the Expense Category report. - * - * @param string|null $expenseCategoryName - * - * @return self */ - public function setExpenseCategoryName(?string $expenseCategoryName) : self + public function setExpenseCategoryName(?string $expenseCategoryName): self { $this->expenseCategoryName = $expenseCategoryName; + return $this; } + /** * The ID of the user associated with the reported expenses. Only returned in the Team report. - * - * @return int|null */ - public function getUserId() : ?int + public function getUserId(): ?int { return $this->userId; } + /** * The ID of the user associated with the reported expenses. Only returned in the Team report. - * - * @param int|null $userId - * - * @return self */ - public function setUserId(?int $userId) : self + public function setUserId(?int $userId): self { $this->userId = $userId; + return $this; } + /** * The name of the user associated with the reported expenses. Only returned in the Team report. - * - * @return string|null */ - public function getUserName() : ?string + public function getUserName(): ?string { return $this->userName; } + /** * The name of the user associated with the reported expenses. Only returned in the Team report. - * - * @param string|null $userName - * - * @return self */ - public function setUserName(?string $userName) : self + public function setUserName(?string $userName): self { $this->userName = $userName; + return $this; } + /** * The contractor status of the user associated with the reported expenses. Only returned in the Team report. - * - * @return bool|null */ - public function getIsContractor() : ?bool + public function getIsContractor(): ?bool { return $this->isContractor; } + /** * The contractor status of the user associated with the reported expenses. Only returned in the Team report. - * - * @param bool|null $isContractor - * - * @return self */ - public function setIsContractor(?bool $isContractor) : self + public function setIsContractor(?bool $isContractor): self { $this->isContractor = $isContractor; + return $this; } + /** * The totaled cost for all expenses for the given timeframe, subject (client, project, expense category, or user), and currency. - * - * @return float|null */ - public function getTotalAmount() : ?float + public function getTotalAmount(): ?float { return $this->totalAmount; } + /** * The totaled cost for all expenses for the given timeframe, subject (client, project, expense category, or user), and currency. - * - * @param float|null $totalAmount - * - * @return self */ - public function setTotalAmount(?float $totalAmount) : self + public function setTotalAmount(?float $totalAmount): self { $this->totalAmount = $totalAmount; + return $this; } + /** * The totaled cost for billable expenses for the given timeframe, subject (client, project, expense category, or user), and currency. - * - * @return float|null */ - public function getBillableAmount() : ?float + public function getBillableAmount(): ?float { return $this->billableAmount; } + /** * The totaled cost for billable expenses for the given timeframe, subject (client, project, expense category, or user), and currency. - * - * @param float|null $billableAmount - * - * @return self */ - public function setBillableAmount(?float $billableAmount) : self + public function setBillableAmount(?float $billableAmount): self { $this->billableAmount = $billableAmount; + return $this; } + /** * The currency code associated with the expenses for this result. - * - * @return string|null */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** * The currency code associated with the expenses for this result. - * - * @param string|null $currency - * - * @return self */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseReportsResults.php b/generated/Model/ExpenseReportsResults.php index 5bbd771..3695493 100644 --- a/generated/Model/ExpenseReportsResults.php +++ b/generated/Model/ExpenseReportsResults.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseReportsResults { /** - * - * * @var ExpenseReportsResult[] */ protected $results; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return ExpenseReportsResult[] */ - public function getResults() : array + public function getResults(): array { return $this->results; } + /** - * - * * @param ExpenseReportsResult[] $results - * - * @return self */ - public function setResults(array $results) : self + public function setResults(array $results): self { $this->results = $results; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpenseUser.php b/generated/Model/ExpenseUser.php index d5b366b..b575925 100644 --- a/generated/Model/ExpenseUser.php +++ b/generated/Model/ExpenseUser.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpenseUser { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Expenses.php b/generated/Model/Expenses.php index 2d806f0..2fe04df 100644 --- a/generated/Model/Expenses.php +++ b/generated/Model/Expenses.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Expenses { /** - * - * * @var Expense[] */ protected $expenses; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Expense[] */ - public function getExpenses() : array + public function getExpenses(): array { return $this->expenses; } + /** - * - * * @param Expense[] $expenses - * - * @return self */ - public function setExpenses(array $expenses) : self + public function setExpenses(array $expenses): self { $this->expenses = $expenses; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpensesExpenseIdPatchBody.php b/generated/Model/ExpensesExpenseIdPatchBody.php index 51c2d62..6d16e6e 100644 --- a/generated/Model/ExpensesExpenseIdPatchBody.php +++ b/generated/Model/ExpensesExpenseIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpensesExpenseIdPatchBody @@ -58,193 +67,166 @@ class ExpensesExpenseIdPatchBody * @var bool|null */ protected $deleteReceipt; + /** * The ID of the project associated with this expense. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project associated with this expense. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The ID of the expense category this expense is being tracked against. - * - * @return int|null */ - public function getExpenseCategoryId() : ?int + public function getExpenseCategoryId(): ?int { return $this->expenseCategoryId; } + /** * The ID of the expense category this expense is being tracked against. - * - * @param int|null $expenseCategoryId - * - * @return self */ - public function setExpenseCategoryId(?int $expenseCategoryId) : self + public function setExpenseCategoryId(?int $expenseCategoryId): self { $this->expenseCategoryId = $expenseCategoryId; + return $this; } + /** * Date the expense occurred. - * - * @return \DateTime|null */ - public function getSpentDate() : ?\DateTime + public function getSpentDate(): ?\DateTime { return $this->spentDate; } + /** * Date the expense occurred. - * - * @param \DateTime|null $spentDate - * - * @return self */ - public function setSpentDate(?\DateTime $spentDate) : self + public function setSpentDate(?\DateTime $spentDate): self { $this->spentDate = $spentDate; + return $this; } + /** * The quantity of units to use in calculating the total_cost of the expense. - * - * @return int|null */ - public function getUnits() : ?int + public function getUnits(): ?int { return $this->units; } + /** * The quantity of units to use in calculating the total_cost of the expense. - * - * @param int|null $units - * - * @return self */ - public function setUnits(?int $units) : self + public function setUnits(?int $units): self { $this->units = $units; + return $this; } + /** * The total amount of the expense. - * - * @return float|null */ - public function getTotalCost() : ?float + public function getTotalCost(): ?float { return $this->totalCost; } + /** * The total amount of the expense. - * - * @param float|null $totalCost - * - * @return self */ - public function setTotalCost(?float $totalCost) : self + public function setTotalCost(?float $totalCost): self { $this->totalCost = $totalCost; + return $this; } + /** * Textual notes used to describe the expense. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Textual notes used to describe the expense. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Whether this expense is billable or not. Defaults to true. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether this expense is billable or not. Defaults to true. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * A receipt file to attach to the expense. If including a receipt, you must submit a multipart/form-data request. - * - * @return string|null */ - public function getReceipt() : ?string + public function getReceipt(): ?string { return $this->receipt; } + /** * A receipt file to attach to the expense. If including a receipt, you must submit a multipart/form-data request. - * - * @param string|null $receipt - * - * @return self */ - public function setReceipt(?string $receipt) : self + public function setReceipt(?string $receipt): self { $this->receipt = $receipt; + return $this; } + /** * Whether an attached expense receipt should be deleted. Pass true to delete the expense receipt. - * - * @return bool|null */ - public function getDeleteReceipt() : ?bool + public function getDeleteReceipt(): ?bool { return $this->deleteReceipt; } + /** * Whether an attached expense receipt should be deleted. Pass true to delete the expense receipt. - * - * @param bool|null $deleteReceipt - * - * @return self */ - public function setDeleteReceipt(?bool $deleteReceipt) : self + public function setDeleteReceipt(?bool $deleteReceipt): self { $this->deleteReceipt = $deleteReceipt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ExpensesPostBody.php b/generated/Model/ExpensesPostBody.php index 815d414..c8ce107 100644 --- a/generated/Model/ExpensesPostBody.php +++ b/generated/Model/ExpensesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ExpensesPostBody @@ -58,193 +67,166 @@ class ExpensesPostBody * @var string|null */ protected $receipt; + /** * The ID of the user associated with this expense. Defaults to the ID of the currently authenticated user. - * - * @return int|null */ - public function getUserId() : ?int + public function getUserId(): ?int { return $this->userId; } + /** * The ID of the user associated with this expense. Defaults to the ID of the currently authenticated user. - * - * @param int|null $userId - * - * @return self */ - public function setUserId(?int $userId) : self + public function setUserId(?int $userId): self { $this->userId = $userId; + return $this; } + /** * The ID of the project associated with this expense. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project associated with this expense. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The ID of the expense category this expense is being tracked against. - * - * @return int|null */ - public function getExpenseCategoryId() : ?int + public function getExpenseCategoryId(): ?int { return $this->expenseCategoryId; } + /** * The ID of the expense category this expense is being tracked against. - * - * @param int|null $expenseCategoryId - * - * @return self */ - public function setExpenseCategoryId(?int $expenseCategoryId) : self + public function setExpenseCategoryId(?int $expenseCategoryId): self { $this->expenseCategoryId = $expenseCategoryId; + return $this; } + /** * Date the expense occurred. - * - * @return \DateTime|null */ - public function getSpentDate() : ?\DateTime + public function getSpentDate(): ?\DateTime { return $this->spentDate; } + /** * Date the expense occurred. - * - * @param \DateTime|null $spentDate - * - * @return self */ - public function setSpentDate(?\DateTime $spentDate) : self + public function setSpentDate(?\DateTime $spentDate): self { $this->spentDate = $spentDate; + return $this; } + /** * The quantity of units to use in calculating the total_cost of the expense. - * - * @return int|null */ - public function getUnits() : ?int + public function getUnits(): ?int { return $this->units; } + /** * The quantity of units to use in calculating the total_cost of the expense. - * - * @param int|null $units - * - * @return self */ - public function setUnits(?int $units) : self + public function setUnits(?int $units): self { $this->units = $units; + return $this; } + /** * The total amount of the expense. - * - * @return float|null */ - public function getTotalCost() : ?float + public function getTotalCost(): ?float { return $this->totalCost; } + /** * The total amount of the expense. - * - * @param float|null $totalCost - * - * @return self */ - public function setTotalCost(?float $totalCost) : self + public function setTotalCost(?float $totalCost): self { $this->totalCost = $totalCost; + return $this; } + /** * Textual notes used to describe the expense. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Textual notes used to describe the expense. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Whether this expense is billable or not. Defaults to true. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether this expense is billable or not. Defaults to true. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * A receipt file to attach to the expense. If including a receipt, you must submit a multipart/form-data request. - * - * @return string|null */ - public function getReceipt() : ?string + public function getReceipt(): ?string { return $this->receipt; } + /** * A receipt file to attach to the expense. If including a receipt, you must submit a multipart/form-data request. - * - * @param string|null $receipt - * - * @return self */ - public function setReceipt(?string $receipt) : self + public function setReceipt(?string $receipt): self { $this->receipt = $receipt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Invoice.php b/generated/Model/Invoice.php index d2339cf..66b53ee 100644 --- a/generated/Model/Invoice.php +++ b/generated/Model/Invoice.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Invoice @@ -41,7 +50,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:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}. * * @var string|null */ @@ -202,697 +211,602 @@ class Invoice * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the invoice. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the invoice. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing invoice’s client id and name. - * - * @return InvoiceClient|null */ - public function getClient() : ?InvoiceClient + public function getClient(): ?InvoiceClient { return $this->client; } + /** * An object containing invoice’s client id and name. - * - * @param InvoiceClient|null $client - * - * @return self */ - public function setClient(?InvoiceClient $client) : self + public function setClient(?InvoiceClient $client): self { $this->client = $client; + return $this; } + /** * Array of invoice line items. * * @return InvoiceLineItem[]|null */ - public function getLineItems() : ?array + public function getLineItems(): ?array { return $this->lineItems; } + /** * Array of invoice line items. * * @param InvoiceLineItem[]|null $lineItems - * - * @return self */ - public function setLineItems(?array $lineItems) : self + public function setLineItems(?array $lineItems): self { $this->lineItems = $lineItems; + return $this; } + /** * An object containing the associated estimate’s id. - * - * @return InvoiceEstimate|null */ - public function getEstimate() : ?InvoiceEstimate + public function getEstimate(): ?InvoiceEstimate { return $this->estimate; } + /** * An object containing the associated estimate’s id. - * - * @param InvoiceEstimate|null $estimate - * - * @return self */ - public function setEstimate(?InvoiceEstimate $estimate) : self + public function setEstimate(?InvoiceEstimate $estimate): self { $this->estimate = $estimate; + return $this; } + /** * An object containing the associated retainer’s id. - * - * @return InvoiceRetainer|null */ - public function getRetainer() : ?InvoiceRetainer + public function getRetainer(): ?InvoiceRetainer { return $this->retainer; } + /** * An object containing the associated retainer’s id. - * - * @param InvoiceRetainer|null $retainer - * - * @return self */ - public function setRetainer(?InvoiceRetainer $retainer) : self + public function setRetainer(?InvoiceRetainer $retainer): self { $this->retainer = $retainer; + return $this; } + /** * An object containing the id and name of the person that created the invoice. - * - * @return InvoiceCreator|null */ - public function getCreator() : ?InvoiceCreator + public function getCreator(): ?InvoiceCreator { return $this->creator; } + /** * An object containing the id and name of the person that created the invoice. - * - * @param InvoiceCreator|null $creator - * - * @return self */ - public function setCreator(?InvoiceCreator $creator) : self + public function setCreator(?InvoiceCreator $creator): self { $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} - * - * @return string|null + * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}. */ - public function getClientKey() : ?string + public function getClientKey(): ?string { return $this->clientKey; } + /** - * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY} - * - * @param string|null $clientKey - * - * @return self + * Used to build a URL to the public web invoice for your client:https://{ACCOUNT_SUBDOMAIN}.harvestapp.com/client/invoices/{CLIENT_KEY}. */ - public function setClientKey(?string $clientKey) : self + public function setClientKey(?string $clientKey): self { $this->clientKey = $clientKey; + return $this; } + /** * If no value is set, the number will be automatically generated. - * - * @return string|null */ - public function getNumber() : ?string + public function getNumber(): ?string { return $this->number; } + /** * If no value is set, the number will be automatically generated. - * - * @param string|null $number - * - * @return self */ - public function setNumber(?string $number) : self + public function setNumber(?string $number): self { $this->number = $number; + return $this; } + /** * The purchase order number. - * - * @return string|null */ - public function getPurchaseOrder() : ?string + public function getPurchaseOrder(): ?string { return $this->purchaseOrder; } + /** * The purchase order number. - * - * @param string|null $purchaseOrder - * - * @return self */ - public function setPurchaseOrder(?string $purchaseOrder) : self + public function setPurchaseOrder(?string $purchaseOrder): self { $this->purchaseOrder = $purchaseOrder; + return $this; } + /** * The total amount for the invoice, including any discounts and taxes. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The total amount for the invoice, including any discounts and taxes. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * The total amount due at this time for this invoice. - * - * @return float|null */ - public function getDueAmount() : ?float + public function getDueAmount(): ?float { return $this->dueAmount; } + /** * The total amount due at this time for this invoice. - * - * @param float|null $dueAmount - * - * @return self */ - public function setDueAmount(?float $dueAmount) : self + public function setDueAmount(?float $dueAmount): self { $this->dueAmount = $dueAmount; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @return float|null */ - public function getTax() : ?float + public function getTax(): ?float { return $this->tax; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @param float|null $tax - * - * @return self */ - public function setTax(?float $tax) : self + public function setTax(?float $tax): self { $this->tax = $tax; + return $this; } + /** * The first amount of tax included, calculated from tax. If no tax is defined, this value will be null. - * - * @return float|null */ - public function getTaxAmount() : ?float + public function getTaxAmount(): ?float { return $this->taxAmount; } + /** * The first amount of tax included, calculated from tax. If no tax is defined, this value will be null. - * - * @param float|null $taxAmount - * - * @return self */ - public function setTaxAmount(?float $taxAmount) : self + public function setTaxAmount(?float $taxAmount): self { $this->taxAmount = $taxAmount; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @return float|null */ - public function getTax2() : ?float + public function getTax2(): ?float { return $this->tax2; } + /** * This percentage is applied to the subtotal, including line items and discounts. - * - * @param float|null $tax2 - * - * @return self */ - public function setTax2(?float $tax2) : self + public function setTax2(?float $tax2): self { $this->tax2 = $tax2; + return $this; } + /** * The amount calculated from tax2. - * - * @return float|null */ - public function getTax2Amount() : ?float + public function getTax2Amount(): ?float { return $this->tax2Amount; } + /** * The amount calculated from tax2. - * - * @param float|null $tax2Amount - * - * @return self */ - public function setTax2Amount(?float $tax2Amount) : self + public function setTax2Amount(?float $tax2Amount): self { $this->tax2Amount = $tax2Amount; + return $this; } + /** * This percentage is subtracted from the subtotal. - * - * @return float|null */ - public function getDiscount() : ?float + public function getDiscount(): ?float { return $this->discount; } + /** * This percentage is subtracted from the subtotal. - * - * @param float|null $discount - * - * @return self */ - public function setDiscount(?float $discount) : self + public function setDiscount(?float $discount): self { $this->discount = $discount; + return $this; } + /** * The amount calcuated from discount. - * - * @return float|null */ - public function getDiscountAmount() : ?float + public function getDiscountAmount(): ?float { return $this->discountAmount; } + /** * The amount calcuated from discount. - * - * @param float|null $discountAmount - * - * @return self */ - public function setDiscountAmount(?float $discountAmount) : self + public function setDiscountAmount(?float $discountAmount): self { $this->discountAmount = $discountAmount; + return $this; } + /** * The invoice subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The invoice subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * Any additional notes included on the invoice. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any additional notes included on the invoice. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * The currency code associated with this invoice. - * - * @return string|null */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** * The currency code associated with this invoice. - * - * @param string|null $currency - * - * @return self */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * The current state of the invoice: draft, open, paid, or closed. - * - * @return string|null */ - public function getState() : ?string + public function getState(): ?string { return $this->state; } + /** * The current state of the invoice: draft, open, paid, or closed. - * - * @param string|null $state - * - * @return self */ - public function setState(?string $state) : self + public function setState(?string $state): self { $this->state = $state; + return $this; } + /** * Start of the period during which time entries were added to this invoice. - * - * @return \DateTime|null */ - public function getPeriodStart() : ?\DateTime + public function getPeriodStart(): ?\DateTime { return $this->periodStart; } + /** * Start of the period during which time entries were added to this invoice. - * - * @param \DateTime|null $periodStart - * - * @return self */ - public function setPeriodStart(?\DateTime $periodStart) : self + public function setPeriodStart(?\DateTime $periodStart): self { $this->periodStart = $periodStart; + return $this; } + /** * End of the period during which time entries were added to this invoice. - * - * @return \DateTime|null */ - public function getPeriodEnd() : ?\DateTime + public function getPeriodEnd(): ?\DateTime { return $this->periodEnd; } + /** * End of the period during which time entries were added to this invoice. - * - * @param \DateTime|null $periodEnd - * - * @return self */ - public function setPeriodEnd(?\DateTime $periodEnd) : self + public function setPeriodEnd(?\DateTime $periodEnd): self { $this->periodEnd = $periodEnd; + return $this; } + /** * Date the invoice was issued. - * - * @return \DateTime|null */ - public function getIssueDate() : ?\DateTime + public function getIssueDate(): ?\DateTime { return $this->issueDate; } + /** * Date the invoice was issued. - * - * @param \DateTime|null $issueDate - * - * @return self */ - public function setIssueDate(?\DateTime $issueDate) : self + public function setIssueDate(?\DateTime $issueDate): self { $this->issueDate = $issueDate; + return $this; } + /** * Date the invoice is due. - * - * @return \DateTime|null */ - public function getDueDate() : ?\DateTime + public function getDueDate(): ?\DateTime { return $this->dueDate; } + /** * Date the invoice is due. - * - * @param \DateTime|null $dueDate - * - * @return self */ - public function setDueDate(?\DateTime $dueDate) : self + public function setDueDate(?\DateTime $dueDate): self { $this->dueDate = $dueDate; + return $this; } + /** * The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, net 60, or custom. - * - * @return string|null */ - public function getPaymentTerm() : ?string + public function getPaymentTerm(): ?string { return $this->paymentTerm; } + /** * The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, net 60, or custom. - * - * @param string|null $paymentTerm - * - * @return self */ - public function setPaymentTerm(?string $paymentTerm) : self + public function setPaymentTerm(?string $paymentTerm): self { $this->paymentTerm = $paymentTerm; + return $this; } + /** * Date and time the invoice was sent. - * - * @return \DateTime|null */ - public function getSentAt() : ?\DateTime + public function getSentAt(): ?\DateTime { return $this->sentAt; } + /** * Date and time the invoice was sent. - * - * @param \DateTime|null $sentAt - * - * @return self */ - public function setSentAt(?\DateTime $sentAt) : self + public function setSentAt(?\DateTime $sentAt): self { $this->sentAt = $sentAt; + return $this; } + /** * Date and time the invoice was paid. - * - * @return \DateTime|null */ - public function getPaidAt() : ?\DateTime + public function getPaidAt(): ?\DateTime { return $this->paidAt; } + /** * Date and time the invoice was paid. - * - * @param \DateTime|null $paidAt - * - * @return self */ - public function setPaidAt(?\DateTime $paidAt) : self + public function setPaidAt(?\DateTime $paidAt): self { $this->paidAt = $paidAt; + return $this; } + /** * Date the invoice was paid. - * - * @return \DateTime|null */ - public function getPaidDate() : ?\DateTime + public function getPaidDate(): ?\DateTime { return $this->paidDate; } + /** * Date the invoice was paid. - * - * @param \DateTime|null $paidDate - * - * @return self */ - public function setPaidDate(?\DateTime $paidDate) : self + public function setPaidDate(?\DateTime $paidDate): self { $this->paidDate = $paidDate; + return $this; } + /** * Date and time the invoice was closed. - * - * @return \DateTime|null */ - public function getClosedAt() : ?\DateTime + public function getClosedAt(): ?\DateTime { return $this->closedAt; } + /** * Date and time the invoice was closed. - * - * @param \DateTime|null $closedAt - * - * @return self */ - public function setClosedAt(?\DateTime $closedAt) : self + public function setClosedAt(?\DateTime $closedAt): self { $this->closedAt = $closedAt; + return $this; } + /** * Unique ID of the associated recurring invoice. - * - * @return int|null */ - public function getRecurringInvoiceId() : ?int + public function getRecurringInvoiceId(): ?int { return $this->recurringInvoiceId; } + /** * Unique ID of the associated recurring invoice. - * - * @param int|null $recurringInvoiceId - * - * @return self */ - public function setRecurringInvoiceId(?int $recurringInvoiceId) : self + public function setRecurringInvoiceId(?int $recurringInvoiceId): self { $this->recurringInvoiceId = $recurringInvoiceId; + return $this; } + /** * Date and time the invoice was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the invoice was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the invoice was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the invoice was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceClient.php b/generated/Model/InvoiceClient.php index 925ed0f..3d27d11 100644 --- a/generated/Model/InvoiceClient.php +++ b/generated/Model/InvoiceClient.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceCreator.php b/generated/Model/InvoiceCreator.php index 8e4bcde..2c7ec7e 100644 --- a/generated/Model/InvoiceCreator.php +++ b/generated/Model/InvoiceCreator.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceCreator { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceEstimate.php b/generated/Model/InvoiceEstimate.php index 55197db..1b16e44 100644 --- a/generated/Model/InvoiceEstimate.php +++ b/generated/Model/InvoiceEstimate.php @@ -1,34 +1,32 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceEstimate { /** - * - * * @var int|null */ protected $id; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceItemCategories.php b/generated/Model/InvoiceItemCategories.php index c16bb4c..75e4dba 100644 --- a/generated/Model/InvoiceItemCategories.php +++ b/generated/Model/InvoiceItemCategories.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceItemCategories { /** - * - * * @var InvoiceItemCategory[] */ protected $invoiceItemCategories; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return InvoiceItemCategory[] */ - public function getInvoiceItemCategories() : array + public function getInvoiceItemCategories(): array { return $this->invoiceItemCategories; } + /** - * - * * @param InvoiceItemCategory[] $invoiceItemCategories - * - * @return self */ - public function setInvoiceItemCategories(array $invoiceItemCategories) : self + public function setInvoiceItemCategories(array $invoiceItemCategories): self { $this->invoiceItemCategories = $invoiceItemCategories; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php b/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php index 6055187..9c901f6 100644 --- a/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php +++ b/generated/Model/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody @@ -10,25 +19,22 @@ class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody * @var string|null */ protected $name; + /** * The name of the invoice item category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the invoice item category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceItemCategoriesPostBody.php b/generated/Model/InvoiceItemCategoriesPostBody.php index 98fd1c5..6f9e6c6 100644 --- a/generated/Model/InvoiceItemCategoriesPostBody.php +++ b/generated/Model/InvoiceItemCategoriesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceItemCategoriesPostBody @@ -10,25 +19,22 @@ class InvoiceItemCategoriesPostBody * @var string|null */ protected $name; + /** * The name of the invoice item category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the invoice item category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceItemCategory.php b/generated/Model/InvoiceItemCategory.php index 4bcfea7..39e7b6e 100644 --- a/generated/Model/InvoiceItemCategory.php +++ b/generated/Model/InvoiceItemCategory.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceItemCategory @@ -40,130 +49,112 @@ class InvoiceItemCategory * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the invoice item category. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the invoice item category. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The name of the invoice item category. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the invoice item category. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Whether this invoice item category is used for billable hours when generating an invoice. - * - * @return bool|null */ - public function getUseAsService() : ?bool + public function getUseAsService(): ?bool { return $this->useAsService; } + /** * Whether this invoice item category is used for billable hours when generating an invoice. - * - * @param bool|null $useAsService - * - * @return self */ - public function setUseAsService(?bool $useAsService) : self + public function setUseAsService(?bool $useAsService): self { $this->useAsService = $useAsService; + return $this; } + /** * Whether this invoice item category is used for expenses when generating an invoice. - * - * @return bool|null */ - public function getUseAsExpense() : ?bool + public function getUseAsExpense(): ?bool { return $this->useAsExpense; } + /** * Whether this invoice item category is used for expenses when generating an invoice. - * - * @param bool|null $useAsExpense - * - * @return self */ - public function setUseAsExpense(?bool $useAsExpense) : self + public function setUseAsExpense(?bool $useAsExpense): self { $this->useAsExpense = $useAsExpense; + return $this; } + /** * Date and time the invoice item category was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the invoice item category was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the invoice item category was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the invoice item category was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceLineItem.php b/generated/Model/InvoiceLineItem.php index 9ee12ef..7c1b442 100644 --- a/generated/Model/InvoiceLineItem.php +++ b/generated/Model/InvoiceLineItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceLineItem @@ -58,193 +67,166 @@ class InvoiceLineItem * @var bool|null */ protected $taxed2; + /** * Unique ID for the line item. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the line item. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing the associated project’s id, name, and code. - * - * @return InvoiceLineItemProject|null */ - public function getProject() : ?InvoiceLineItemProject + public function getProject(): ?InvoiceLineItemProject { return $this->project; } + /** * An object containing the associated project’s id, name, and code. - * - * @param InvoiceLineItemProject|null $project - * - * @return self */ - public function setProject(?InvoiceLineItemProject $project) : self + public function setProject(?InvoiceLineItemProject $project): self { $this->project = $project; + return $this; } + /** * The name of an invoice item category. - * - * @return string|null */ - public function getKind() : ?string + public function getKind(): ?string { return $this->kind; } + /** * The name of an invoice item category. - * - * @param string|null $kind - * - * @return self */ - public function setKind(?string $kind) : self + public function setKind(?string $kind): self { $this->kind = $kind; + return $this; } + /** * Text description of the line item. - * - * @return string|null */ - public function getDescription() : ?string + public function getDescription(): ?string { return $this->description; } + /** * Text description of the line item. - * - * @param string|null $description - * - * @return self */ - public function setDescription(?string $description) : self + public function setDescription(?string $description): self { $this->description = $description; + return $this; } + /** * The unit quantity of the item. - * - * @return float|null */ - public function getQuantity() : ?float + public function getQuantity(): ?float { return $this->quantity; } + /** * The unit quantity of the item. - * - * @param float|null $quantity - * - * @return self */ - public function setQuantity(?float $quantity) : self + public function setQuantity(?float $quantity): self { $this->quantity = $quantity; + return $this; } + /** * The individual price per unit. - * - * @return float|null */ - public function getUnitPrice() : ?float + public function getUnitPrice(): ?float { return $this->unitPrice; } + /** * The individual price per unit. - * - * @param float|null $unitPrice - * - * @return self */ - public function setUnitPrice(?float $unitPrice) : self + public function setUnitPrice(?float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * The line item subtotal (quantity * unit_price). - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The line item subtotal (quantity * unit_price). - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * Whether the invoice’s tax percentage applies to this line item. - * - * @return bool|null */ - public function getTaxed() : ?bool + public function getTaxed(): ?bool { return $this->taxed; } + /** * Whether the invoice’s tax percentage applies to this line item. - * - * @param bool|null $taxed - * - * @return self */ - public function setTaxed(?bool $taxed) : self + public function setTaxed(?bool $taxed): self { $this->taxed = $taxed; + return $this; } + /** * Whether the invoice’s tax2 percentage applies to this line item. - * - * @return bool|null */ - public function getTaxed2() : ?bool + public function getTaxed2(): ?bool { return $this->taxed2; } + /** * Whether the invoice’s tax2 percentage applies to this line item. - * - * @param bool|null $taxed2 - * - * @return self */ - public function setTaxed2(?bool $taxed2) : self + public function setTaxed2(?bool $taxed2): self { $this->taxed2 = $taxed2; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceLineItemProject.php b/generated/Model/InvoiceLineItemProject.php index 7923c0b..f749d1f 100644 --- a/generated/Model/InvoiceLineItemProject.php +++ b/generated/Model/InvoiceLineItemProject.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceLineItemProject { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $code; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCode() : ?string + + public function getCode(): ?string { return $this->code; } - /** - * - * - * @param string|null $code - * - * @return self - */ - public function setCode(?string $code) : self + + public function setCode(?string $code): self { $this->code = $code; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceLineItems.php b/generated/Model/InvoiceLineItems.php index 7a326a6..888ff17 100644 --- a/generated/Model/InvoiceLineItems.php +++ b/generated/Model/InvoiceLineItems.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceLineItems { /** - * - * * @var InvoiceLineItem[] */ protected $invoiceLineItems; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return InvoiceLineItem[] */ - public function getInvoiceLineItems() : array + public function getInvoiceLineItems(): array { return $this->invoiceLineItems; } + /** - * - * * @param InvoiceLineItem[] $invoiceLineItems - * - * @return self */ - public function setInvoiceLineItems(array $invoiceLineItems) : self + public function setInvoiceLineItems(array $invoiceLineItems): self { $this->invoiceLineItems = $invoiceLineItems; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceMessage.php b/generated/Model/InvoiceMessage.php index 5d817a5..4d86c82 100644 --- a/generated/Model/InvoiceMessage.php +++ b/generated/Model/InvoiceMessage.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceMessage @@ -106,361 +115,314 @@ class InvoiceMessage * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the message. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the message. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * Name of the user that created the message. - * - * @return string|null */ - public function getSentBy() : ?string + public function getSentBy(): ?string { return $this->sentBy; } + /** * Name of the user that created the message. - * - * @param string|null $sentBy - * - * @return self */ - public function setSentBy(?string $sentBy) : self + public function setSentBy(?string $sentBy): self { $this->sentBy = $sentBy; + return $this; } + /** * Email of the user that created the message. - * - * @return string|null */ - public function getSentByEmail() : ?string + public function getSentByEmail(): ?string { return $this->sentByEmail; } + /** * Email of the user that created the message. - * - * @param string|null $sentByEmail - * - * @return self */ - public function setSentByEmail(?string $sentByEmail) : self + public function setSentByEmail(?string $sentByEmail): self { $this->sentByEmail = $sentByEmail; + return $this; } + /** * Name of the user that the message was sent from. - * - * @return string|null */ - public function getSentFrom() : ?string + public function getSentFrom(): ?string { return $this->sentFrom; } + /** * Name of the user that the message was sent from. - * - * @param string|null $sentFrom - * - * @return self */ - public function setSentFrom(?string $sentFrom) : self + public function setSentFrom(?string $sentFrom): self { $this->sentFrom = $sentFrom; + return $this; } + /** * Email of the user that message was sent from. - * - * @return string|null */ - public function getSentFromEmail() : ?string + public function getSentFromEmail(): ?string { return $this->sentFromEmail; } + /** * Email of the user that message was sent from. - * - * @param string|null $sentFromEmail - * - * @return self */ - public function setSentFromEmail(?string $sentFromEmail) : self + public function setSentFromEmail(?string $sentFromEmail): self { $this->sentFromEmail = $sentFromEmail; + return $this; } + /** * Array of invoice message recipients. * * @return InvoiceMessageRecipient[]|null */ - public function getRecipients() : ?array + public function getRecipients(): ?array { return $this->recipients; } + /** * Array of invoice message recipients. * * @param InvoiceMessageRecipient[]|null $recipients - * - * @return self */ - public function setRecipients(?array $recipients) : self + public function setRecipients(?array $recipients): self { $this->recipients = $recipients; + return $this; } + /** * The message subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The message subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * The message body. - * - * @return string|null */ - public function getBody() : ?string + public function getBody(): ?string { return $this->body; } + /** * The message body. - * - * @param string|null $body - * - * @return self */ - public function setBody(?string $body) : self + public function setBody(?string $body): self { $this->body = $body; + return $this; } + /** * Whether to include a link to the client invoice in the message body. Not used when thank_you is true. - * - * @return bool|null */ - public function getIncludeLinkToClientInvoice() : ?bool + public function getIncludeLinkToClientInvoice(): ?bool { return $this->includeLinkToClientInvoice; } + /** * Whether to include a link to the client invoice in the message body. Not used when thank_you is true. - * - * @param bool|null $includeLinkToClientInvoice - * - * @return self */ - public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice) : self + public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice): self { $this->includeLinkToClientInvoice = $includeLinkToClientInvoice; + return $this; } + /** * Whether to attach the invoice PDF to the message email. - * - * @return bool|null */ - public function getAttachPdf() : ?bool + public function getAttachPdf(): ?bool { return $this->attachPdf; } + /** * Whether to attach the invoice PDF to the message email. - * - * @param bool|null $attachPdf - * - * @return self */ - public function setAttachPdf(?bool $attachPdf) : self + public function setAttachPdf(?bool $attachPdf): self { $this->attachPdf = $attachPdf; + return $this; } + /** * Whether to email a copy of the message to the current user. - * - * @return bool|null */ - public function getSendMeACopy() : ?bool + public function getSendMeACopy(): ?bool { return $this->sendMeACopy; } + /** * Whether to email a copy of the message to the current user. - * - * @param bool|null $sendMeACopy - * - * @return self */ - public function setSendMeACopy(?bool $sendMeACopy) : self + public function setSendMeACopy(?bool $sendMeACopy): self { $this->sendMeACopy = $sendMeACopy; + return $this; } + /** * Whether this is a thank you message. - * - * @return bool|null */ - public function getThankYou() : ?bool + public function getThankYou(): ?bool { return $this->thankYou; } + /** * Whether this is a thank you message. - * - * @param bool|null $thankYou - * - * @return self */ - public function setThankYou(?bool $thankYou) : self + public function setThankYou(?bool $thankYou): self { $this->thankYou = $thankYou; + return $this; } + /** * The type of invoice event that occurred with the message: send, close, draft, re-open, or view. - * - * @return string|null */ - public function getEventType() : ?string + public function getEventType(): ?string { return $this->eventType; } + /** * The type of invoice event that occurred with the message: send, close, draft, re-open, or view. - * - * @param string|null $eventType - * - * @return self */ - public function setEventType(?string $eventType) : self + public function setEventType(?string $eventType): self { $this->eventType = $eventType; + return $this; } + /** * Whether this is a reminder message. - * - * @return bool|null */ - public function getReminder() : ?bool + public function getReminder(): ?bool { return $this->reminder; } + /** * Whether this is a reminder message. - * - * @param bool|null $reminder - * - * @return self */ - public function setReminder(?bool $reminder) : self + public function setReminder(?bool $reminder): self { $this->reminder = $reminder; + return $this; } + /** * The date the reminder email will be sent. - * - * @return \DateTime|null */ - public function getSendReminderOn() : ?\DateTime + public function getSendReminderOn(): ?\DateTime { return $this->sendReminderOn; } + /** * The date the reminder email will be sent. - * - * @param \DateTime|null $sendReminderOn - * - * @return self */ - public function setSendReminderOn(?\DateTime $sendReminderOn) : self + public function setSendReminderOn(?\DateTime $sendReminderOn): self { $this->sendReminderOn = $sendReminderOn; + return $this; } + /** * Date and time the message was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the message was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the message was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the message was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceMessageRecipient.php b/generated/Model/InvoiceMessageRecipient.php index 1e7eadf..3c33f85 100644 --- a/generated/Model/InvoiceMessageRecipient.php +++ b/generated/Model/InvoiceMessageRecipient.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceMessageRecipient @@ -16,46 +25,40 @@ class InvoiceMessageRecipient * @var string|null */ protected $email; + /** * Name of the message recipient. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * Name of the message recipient. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Email of the message recipient. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * Email of the message recipient. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceMessageRecipients.php b/generated/Model/InvoiceMessageRecipients.php index f8ef1cd..0d715d9 100644 --- a/generated/Model/InvoiceMessageRecipients.php +++ b/generated/Model/InvoiceMessageRecipients.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceMessageRecipients { /** - * - * * @var InvoiceMessageRecipient[] */ protected $invoiceMessageRecipients; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return InvoiceMessageRecipient[] */ - public function getInvoiceMessageRecipients() : array + public function getInvoiceMessageRecipients(): array { return $this->invoiceMessageRecipients; } + /** - * - * * @param InvoiceMessageRecipient[] $invoiceMessageRecipients - * - * @return self */ - public function setInvoiceMessageRecipients(array $invoiceMessageRecipients) : self + public function setInvoiceMessageRecipients(array $invoiceMessageRecipients): self { $this->invoiceMessageRecipients = $invoiceMessageRecipients; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceMessages.php b/generated/Model/InvoiceMessages.php index 5de22e4..53b0148 100644 --- a/generated/Model/InvoiceMessages.php +++ b/generated/Model/InvoiceMessages.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceMessages { /** - * - * * @var InvoiceMessage[] */ protected $invoiceMessages; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return InvoiceMessage[] */ - public function getInvoiceMessages() : array + public function getInvoiceMessages(): array { return $this->invoiceMessages; } + /** - * - * * @param InvoiceMessage[] $invoiceMessages - * - * @return self */ - public function setInvoiceMessages(array $invoiceMessages) : self + public function setInvoiceMessages(array $invoiceMessages): self { $this->invoiceMessages = $invoiceMessages; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicePayment.php b/generated/Model/InvoicePayment.php index 9521f16..4897211 100644 --- a/generated/Model/InvoicePayment.php +++ b/generated/Model/InvoicePayment.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicePayment @@ -70,235 +79,202 @@ class InvoicePayment * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the payment. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the payment. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The amount of the payment. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The amount of the payment. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * Date and time the payment was made. - * - * @return \DateTime|null */ - public function getPaidAt() : ?\DateTime + public function getPaidAt(): ?\DateTime { return $this->paidAt; } + /** * Date and time the payment was made. - * - * @param \DateTime|null $paidAt - * - * @return self */ - public function setPaidAt(?\DateTime $paidAt) : self + public function setPaidAt(?\DateTime $paidAt): self { $this->paidAt = $paidAt; + return $this; } + /** * Date the payment was made. - * - * @return \DateTime|null */ - public function getPaidDate() : ?\DateTime + public function getPaidDate(): ?\DateTime { return $this->paidDate; } + /** * Date the payment was made. - * - * @param \DateTime|null $paidDate - * - * @return self */ - public function setPaidDate(?\DateTime $paidDate) : self + public function setPaidDate(?\DateTime $paidDate): self { $this->paidDate = $paidDate; + return $this; } + /** * The name of the person who recorded the payment. - * - * @return string|null */ - public function getRecordedBy() : ?string + public function getRecordedBy(): ?string { return $this->recordedBy; } + /** * The name of the person who recorded the payment. - * - * @param string|null $recordedBy - * - * @return self */ - public function setRecordedBy(?string $recordedBy) : self + public function setRecordedBy(?string $recordedBy): self { $this->recordedBy = $recordedBy; + return $this; } + /** * The email of the person who recorded the payment. - * - * @return string|null */ - public function getRecordedByEmail() : ?string + public function getRecordedByEmail(): ?string { return $this->recordedByEmail; } + /** * The email of the person who recorded the payment. - * - * @param string|null $recordedByEmail - * - * @return self */ - public function setRecordedByEmail(?string $recordedByEmail) : self + public function setRecordedByEmail(?string $recordedByEmail): self { $this->recordedByEmail = $recordedByEmail; + return $this; } + /** * Any notes associated with the payment. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any notes associated with the payment. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Either the card authorization or PayPal transaction ID. - * - * @return string|null */ - public function getTransactionId() : ?string + public function getTransactionId(): ?string { return $this->transactionId; } + /** * Either the card authorization or PayPal transaction ID. - * - * @param string|null $transactionId - * - * @return self */ - public function setTransactionId(?string $transactionId) : self + public function setTransactionId(?string $transactionId): self { $this->transactionId = $transactionId; + return $this; } + /** * The payment gateway id and name used to process the payment. - * - * @return InvoicePaymentPaymentGateway|null */ - public function getPaymentGateway() : ?InvoicePaymentPaymentGateway + public function getPaymentGateway(): ?InvoicePaymentPaymentGateway { return $this->paymentGateway; } + /** * The payment gateway id and name used to process the payment. - * - * @param InvoicePaymentPaymentGateway|null $paymentGateway - * - * @return self */ - public function setPaymentGateway(?InvoicePaymentPaymentGateway $paymentGateway) : self + public function setPaymentGateway(?InvoicePaymentPaymentGateway $paymentGateway): self { $this->paymentGateway = $paymentGateway; + return $this; } + /** * Date and time the payment was recorded. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the payment was recorded. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the payment was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the payment was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicePaymentPaymentGateway.php b/generated/Model/InvoicePaymentPaymentGateway.php index bc5b061..51fcd53 100644 --- a/generated/Model/InvoicePaymentPaymentGateway.php +++ b/generated/Model/InvoicePaymentPaymentGateway.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicePaymentPaymentGateway { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicePayments.php b/generated/Model/InvoicePayments.php index 73a4df5..d38d13f 100644 --- a/generated/Model/InvoicePayments.php +++ b/generated/Model/InvoicePayments.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicePayments { /** - * - * * @var InvoicePayment[] */ protected $invoicePayments; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return InvoicePayment[] */ - public function getInvoicePayments() : array + public function getInvoicePayments(): array { return $this->invoicePayments; } + /** - * - * * @param InvoicePayment[] $invoicePayments - * - * @return self */ - public function setInvoicePayments(array $invoicePayments) : self + public function setInvoicePayments(array $invoicePayments): self { $this->invoicePayments = $invoicePayments; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoiceRetainer.php b/generated/Model/InvoiceRetainer.php index be51e99..a5a37c4 100644 --- a/generated/Model/InvoiceRetainer.php +++ b/generated/Model/InvoiceRetainer.php @@ -1,34 +1,32 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoiceRetainer { /** - * - * * @var int|null */ protected $id; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Invoices.php b/generated/Model/Invoices.php index b7195f0..880e3a4 100644 --- a/generated/Model/Invoices.php +++ b/generated/Model/Invoices.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Invoices { /** - * - * * @var Invoice[] */ protected $invoices; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Invoice[] */ - public function getInvoices() : array + public function getInvoices(): array { return $this->invoices; } + /** - * - * * @param Invoice[] $invoices - * - * @return self */ - public function setInvoices(array $invoices) : self + public function setInvoices(array $invoices): self { $this->invoices = $invoices; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesInvoiceIdMessagesPostBody.php b/generated/Model/InvoicesInvoiceIdMessagesPostBody.php index 90a8844..547b2ab 100644 --- a/generated/Model/InvoicesInvoiceIdMessagesPostBody.php +++ b/generated/Model/InvoicesInvoiceIdMessagesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesInvoiceIdMessagesPostBody @@ -52,172 +61,152 @@ class InvoicesInvoiceIdMessagesPostBody * @var bool|null */ protected $thankYou; + /** * If provided, runs an event against the invoice. Options: close, draft, re-open, or send. - * - * @return string|null */ - public function getEventType() : ?string + public function getEventType(): ?string { return $this->eventType; } + /** * If provided, runs an event against the invoice. Options: close, draft, re-open, or send. - * - * @param string|null $eventType - * - * @return self */ - public function setEventType(?string $eventType) : self + public function setEventType(?string $eventType): self { $this->eventType = $eventType; + return $this; } + /** * Array of recipient parameters. See below for details. * * @return InvoicesInvoiceIdMessagesPostBodyRecipientsItem[]|null */ - public function getRecipients() : ?array + public function getRecipients(): ?array { return $this->recipients; } + /** * Array of recipient parameters. See below for details. * * @param InvoicesInvoiceIdMessagesPostBodyRecipientsItem[]|null $recipients - * - * @return self */ - public function setRecipients(?array $recipients) : self + public function setRecipients(?array $recipients): self { $this->recipients = $recipients; + return $this; } + /** * The message subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The message subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * The message body. - * - * @return string|null */ - public function getBody() : ?string + public function getBody(): ?string { return $this->body; } + /** * The message body. - * - * @param string|null $body - * - * @return self */ - public function setBody(?string $body) : self + public function setBody(?string $body): self { $this->body = $body; + return $this; } + /** * If set to true, a link to the client invoice URL will be included in the message email. Defaults to false. Ignored when thank_you is set to true. - * - * @return bool|null */ - public function getIncludeLinkToClientInvoice() : ?bool + public function getIncludeLinkToClientInvoice(): ?bool { return $this->includeLinkToClientInvoice; } + /** * If set to true, a link to the client invoice URL will be included in the message email. Defaults to false. Ignored when thank_you is set to true. - * - * @param bool|null $includeLinkToClientInvoice - * - * @return self */ - public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice) : self + public function setIncludeLinkToClientInvoice(?bool $includeLinkToClientInvoice): self { $this->includeLinkToClientInvoice = $includeLinkToClientInvoice; + return $this; } + /** * If set to true, a PDF of the invoice will be attached to the message email. Defaults to false. - * - * @return bool|null */ - public function getAttachPdf() : ?bool + public function getAttachPdf(): ?bool { return $this->attachPdf; } + /** * If set to true, a PDF of the invoice will be attached to the message email. Defaults to false. - * - * @param bool|null $attachPdf - * - * @return self */ - public function setAttachPdf(?bool $attachPdf) : self + public function setAttachPdf(?bool $attachPdf): self { $this->attachPdf = $attachPdf; + return $this; } + /** * If set to true, a copy of the message email will be sent to the current user. Defaults to false. - * - * @return bool|null */ - public function getSendMeACopy() : ?bool + public function getSendMeACopy(): ?bool { return $this->sendMeACopy; } + /** * If set to true, a copy of the message email will be sent to the current user. Defaults to false. - * - * @param bool|null $sendMeACopy - * - * @return self */ - public function setSendMeACopy(?bool $sendMeACopy) : self + public function setSendMeACopy(?bool $sendMeACopy): self { $this->sendMeACopy = $sendMeACopy; + return $this; } + /** * If set to true, a thank you message email will be sent. Defaults to false. - * - * @return bool|null */ - public function getThankYou() : ?bool + public function getThankYou(): ?bool { return $this->thankYou; } + /** * If set to true, a thank you message email will be sent. Defaults to false. - * - * @param bool|null $thankYou - * - * @return self */ - public function setThankYou(?bool $thankYou) : self + public function setThankYou(?bool $thankYou): self { $this->thankYou = $thankYou; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php b/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php index 0c51fa6..3a7baf0 100644 --- a/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php +++ b/generated/Model/InvoicesInvoiceIdMessagesPostBodyRecipientsItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesInvoiceIdMessagesPostBodyRecipientsItem @@ -16,46 +25,40 @@ class InvoicesInvoiceIdMessagesPostBodyRecipientsItem * @var string */ protected $email; + /** * Name of the message recipient. - * - * @return string */ - public function getName() : string + public function getName(): string { return $this->name; } + /** * Name of the message recipient. - * - * @param string $name - * - * @return self */ - public function setName(string $name) : self + public function setName(string $name): self { $this->name = $name; + return $this; } + /** * Email of the message recipient. - * - * @return string */ - public function getEmail() : string + public function getEmail(): string { return $this->email; } + /** * Email of the message recipient. - * - * @param string $email - * - * @return self */ - public function setEmail(string $email) : self + public function setEmail(string $email): self { $this->email = $email; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesInvoiceIdPatchBody.php b/generated/Model/InvoicesInvoiceIdPatchBody.php index 69b623f..f051fb1 100644 --- a/generated/Model/InvoicesInvoiceIdPatchBody.php +++ b/generated/Model/InvoicesInvoiceIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesInvoiceIdPatchBody @@ -65,7 +74,7 @@ class InvoicesInvoiceIdPatchBody */ protected $notes; /** - * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies + * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies. * * @var string|null */ @@ -89,324 +98,283 @@ class InvoicesInvoiceIdPatchBody */ protected $paymentTerm; /** - * Array of line item parameters + * Array of line item parameters. * * @var InvoicesInvoiceIdPatchBodyLineItemsItem[]|null */ protected $lineItems; + /** * The ID of the client this invoice belongs to. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client this invoice belongs to. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The ID of the retainer associated with this invoice. - * - * @return int|null */ - public function getRetainerId() : ?int + public function getRetainerId(): ?int { return $this->retainerId; } + /** * The ID of the retainer associated with this invoice. - * - * @param int|null $retainerId - * - * @return self */ - public function setRetainerId(?int $retainerId) : self + public function setRetainerId(?int $retainerId): self { $this->retainerId = $retainerId; + return $this; } + /** * The ID of the estimate associated with this invoice. - * - * @return int|null */ - public function getEstimateId() : ?int + public function getEstimateId(): ?int { return $this->estimateId; } + /** * The ID of the estimate associated with this invoice. - * - * @param int|null $estimateId - * - * @return self */ - public function setEstimateId(?int $estimateId) : self + public function setEstimateId(?int $estimateId): self { $this->estimateId = $estimateId; + return $this; } + /** * If no value is set, the number will be automatically generated. - * - * @return string|null */ - public function getNumber() : ?string + public function getNumber(): ?string { return $this->number; } + /** * If no value is set, the number will be automatically generated. - * - * @param string|null $number - * - * @return self */ - public function setNumber(?string $number) : self + public function setNumber(?string $number): self { $this->number = $number; + return $this; } + /** * The purchase order number. - * - * @return string|null */ - public function getPurchaseOrder() : ?string + public function getPurchaseOrder(): ?string { return $this->purchaseOrder; } + /** * The purchase order number. - * - * @param string|null $purchaseOrder - * - * @return self */ - public function setPurchaseOrder(?string $purchaseOrder) : self + public function setPurchaseOrder(?string $purchaseOrder): self { $this->purchaseOrder = $purchaseOrder; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax() : ?float + public function getTax(): ?float { return $this->tax; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax - * - * @return self */ - public function setTax(?float $tax) : self + public function setTax(?float $tax): self { $this->tax = $tax; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax2() : ?float + public function getTax2(): ?float { return $this->tax2; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax2 - * - * @return self */ - public function setTax2(?float $tax2) : self + public function setTax2(?float $tax2): self { $this->tax2 = $tax2; + return $this; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getDiscount() : ?float + public function getDiscount(): ?float { return $this->discount; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @param float|null $discount - * - * @return self */ - public function setDiscount(?float $discount) : self + public function setDiscount(?float $discount): self { $this->discount = $discount; + return $this; } + /** * The invoice subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The invoice subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * Any additional notes to include on the invoice. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any additional notes to include on the invoice. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** - * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @return string|null + * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** - * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @param string|null $currency - * - * @return self + * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * Date the invoice was issued. - * - * @return \DateTime|null */ - public function getIssueDate() : ?\DateTime + public function getIssueDate(): ?\DateTime { return $this->issueDate; } + /** * Date the invoice was issued. - * - * @param \DateTime|null $issueDate - * - * @return self */ - public function setIssueDate(?\DateTime $issueDate) : self + public function setIssueDate(?\DateTime $issueDate): self { $this->issueDate = $issueDate; + return $this; } + /** * Date the invoice is due. - * - * @return \DateTime|null */ - public function getDueDate() : ?\DateTime + public function getDueDate(): ?\DateTime { return $this->dueDate; } + /** * Date the invoice is due. - * - * @param \DateTime|null $dueDate - * - * @return self */ - public function setDueDate(?\DateTime $dueDate) : self + public function setDueDate(?\DateTime $dueDate): self { $this->dueDate = $dueDate; + return $this; } + /** * The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, or net 60. - * - * @return string|null */ - public function getPaymentTerm() : ?string + public function getPaymentTerm(): ?string { return $this->paymentTerm; } + /** * The timeframe in which the invoice should be paid. Options: upon receipt, net 15, net 30, net 45, or net 60. - * - * @param string|null $paymentTerm - * - * @return self */ - public function setPaymentTerm(?string $paymentTerm) : self + public function setPaymentTerm(?string $paymentTerm): self { $this->paymentTerm = $paymentTerm; + return $this; } + /** - * Array of line item parameters + * Array of line item parameters. * * @return InvoicesInvoiceIdPatchBodyLineItemsItem[]|null */ - public function getLineItems() : ?array + public function getLineItems(): ?array { return $this->lineItems; } + /** - * Array of line item parameters + * Array of line item parameters. * * @param InvoicesInvoiceIdPatchBodyLineItemsItem[]|null $lineItems - * - * @return self */ - public function setLineItems(?array $lineItems) : self + public function setLineItems(?array $lineItems): self { $this->lineItems = $lineItems; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php b/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php index 7917eab..21963b3 100644 --- a/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php +++ b/generated/Model/InvoicesInvoiceIdPatchBodyLineItemsItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesInvoiceIdPatchBodyLineItemsItem @@ -52,172 +61,148 @@ class InvoicesInvoiceIdPatchBodyLineItemsItem * @var bool */ protected $taxed2; + /** * Unique ID for the line item. - * - * @return int */ - public function getId() : int + public function getId(): int { return $this->id; } + /** * Unique ID for the line item. - * - * @param int $id - * - * @return self */ - public function setId(int $id) : self + public function setId(int $id): self { $this->id = $id; + return $this; } + /** * The ID of the project associated with this line item. - * - * @return int */ - public function getProjectId() : int + public function getProjectId(): int { return $this->projectId; } + /** * The ID of the project associated with this line item. - * - * @param int $projectId - * - * @return self */ - public function setProjectId(int $projectId) : self + public function setProjectId(int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The name of an invoice item category. - * - * @return string */ - public function getKind() : string + public function getKind(): string { return $this->kind; } + /** * The name of an invoice item category. - * - * @param string $kind - * - * @return self */ - public function setKind(string $kind) : self + public function setKind(string $kind): self { $this->kind = $kind; + return $this; } + /** * Text description of the line item. - * - * @return string */ - public function getDescription() : string + public function getDescription(): string { return $this->description; } + /** * Text description of the line item. - * - * @param string $description - * - * @return self */ - public function setDescription(string $description) : self + public function setDescription(string $description): self { $this->description = $description; + return $this; } + /** * The unit quantity of the item. Defaults to 1. - * - * @return float */ - public function getQuantity() : float + public function getQuantity(): float { return $this->quantity; } + /** * The unit quantity of the item. Defaults to 1. - * - * @param float $quantity - * - * @return self */ - public function setQuantity(float $quantity) : self + public function setQuantity(float $quantity): self { $this->quantity = $quantity; + return $this; } + /** * The individual price per unit. - * - * @return float */ - public function getUnitPrice() : float + public function getUnitPrice(): float { return $this->unitPrice; } + /** * The individual price per unit. - * - * @param float $unitPrice - * - * @return self */ - public function setUnitPrice(float $unitPrice) : self + public function setUnitPrice(float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the invoice’s tax percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed() : bool + public function getTaxed(): bool { return $this->taxed; } + /** * Whether the invoice’s tax percentage applies to this line item. Defaults to false. - * - * @param bool $taxed - * - * @return self */ - public function setTaxed(bool $taxed) : self + public function setTaxed(bool $taxed): self { $this->taxed = $taxed; + return $this; } + /** * Whether the invoice’s tax2 percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed2() : bool + public function getTaxed2(): bool { return $this->taxed2; } + /** * Whether the invoice’s tax2 percentage applies to this line item. Defaults to false. - * - * @param bool $taxed2 - * - * @return self */ - public function setTaxed2(bool $taxed2) : self + public function setTaxed2(bool $taxed2): self { $this->taxed2 = $taxed2; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php b/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php index 89c7fc8..ae5b38d 100644 --- a/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php +++ b/generated/Model/InvoicesInvoiceIdPaymentsPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesInvoiceIdPaymentsPostBody @@ -28,88 +37,76 @@ class InvoicesInvoiceIdPaymentsPostBody * @var string|null */ protected $notes; + /** * The amount of the payment. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The amount of the payment. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * Date and time the payment was made. Pass either paid_at or paid_date, but not both. - * - * @return \DateTime|null */ - public function getPaidAt() : ?\DateTime + public function getPaidAt(): ?\DateTime { return $this->paidAt; } + /** * Date and time the payment was made. Pass either paid_at or paid_date, but not both. - * - * @param \DateTime|null $paidAt - * - * @return self */ - public function setPaidAt(?\DateTime $paidAt) : self + public function setPaidAt(?\DateTime $paidAt): self { $this->paidAt = $paidAt; + return $this; } + /** * Date the payment was made. Pass either paid_at or paid_date, but not both. - * - * @return \DateTime|null */ - public function getPaidDate() : ?\DateTime + public function getPaidDate(): ?\DateTime { return $this->paidDate; } + /** * Date the payment was made. Pass either paid_at or paid_date, but not both. - * - * @param \DateTime|null $paidDate - * - * @return self */ - public function setPaidDate(?\DateTime $paidDate) : self + public function setPaidDate(?\DateTime $paidDate): self { $this->paidDate = $paidDate; + return $this; } + /** * Any notes to be associated with the payment. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any notes to be associated with the payment. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesPostBody.php b/generated/Model/InvoicesPostBody.php index e5f9fca..10ad6e4 100644 --- a/generated/Model/InvoicesPostBody.php +++ b/generated/Model/InvoicesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesPostBody @@ -65,7 +74,7 @@ class InvoicesPostBody */ protected $notes; /** - * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies + * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies. * * @var string|null */ @@ -89,351 +98,307 @@ class InvoicesPostBody */ protected $paymentTerm; /** - * An line items import object + * An line items import object. * * @var InvoicesPostBodyLineItemsImport|null */ protected $lineItemsImport; /** - * Array of line item parameters + * Array of line item parameters. * * @var InvoicesPostBodyLineItemsItem[]|null */ protected $lineItems; + /** * The ID of the client this invoice belongs to. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client this invoice belongs to. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The ID of the retainer associated with this invoice. - * - * @return int|null */ - public function getRetainerId() : ?int + public function getRetainerId(): ?int { return $this->retainerId; } + /** * The ID of the retainer associated with this invoice. - * - * @param int|null $retainerId - * - * @return self */ - public function setRetainerId(?int $retainerId) : self + public function setRetainerId(?int $retainerId): self { $this->retainerId = $retainerId; + return $this; } + /** * The ID of the estimate associated with this invoice. - * - * @return int|null */ - public function getEstimateId() : ?int + public function getEstimateId(): ?int { return $this->estimateId; } + /** * The ID of the estimate associated with this invoice. - * - * @param int|null $estimateId - * - * @return self */ - public function setEstimateId(?int $estimateId) : self + public function setEstimateId(?int $estimateId): self { $this->estimateId = $estimateId; + return $this; } + /** * If no value is set, the number will be automatically generated. - * - * @return string|null */ - public function getNumber() : ?string + public function getNumber(): ?string { return $this->number; } + /** * If no value is set, the number will be automatically generated. - * - * @param string|null $number - * - * @return self */ - public function setNumber(?string $number) : self + public function setNumber(?string $number): self { $this->number = $number; + return $this; } + /** * The purchase order number. - * - * @return string|null */ - public function getPurchaseOrder() : ?string + public function getPurchaseOrder(): ?string { return $this->purchaseOrder; } + /** * The purchase order number. - * - * @param string|null $purchaseOrder - * - * @return self */ - public function setPurchaseOrder(?string $purchaseOrder) : self + public function setPurchaseOrder(?string $purchaseOrder): self { $this->purchaseOrder = $purchaseOrder; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax() : ?float + public function getTax(): ?float { return $this->tax; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax - * - * @return self */ - public function setTax(?float $tax) : self + public function setTax(?float $tax): self { $this->tax = $tax; + return $this; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getTax2() : ?float + public function getTax2(): ?float { return $this->tax2; } + /** * This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. - * - * @param float|null $tax2 - * - * @return self */ - public function setTax2(?float $tax2) : self + public function setTax2(?float $tax2): self { $this->tax2 = $tax2; + return $this; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getDiscount() : ?float + public function getDiscount(): ?float { return $this->discount; } + /** * This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. - * - * @param float|null $discount - * - * @return self */ - public function setDiscount(?float $discount) : self + public function setDiscount(?float $discount): self { $this->discount = $discount; + return $this; } + /** * The invoice subject. - * - * @return string|null */ - public function getSubject() : ?string + public function getSubject(): ?string { return $this->subject; } + /** * The invoice subject. - * - * @param string|null $subject - * - * @return self */ - public function setSubject(?string $subject) : self + public function setSubject(?string $subject): self { $this->subject = $subject; + return $this; } + /** * Any additional notes to include on the invoice. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any additional notes to include on the invoice. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** - * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @return string|null + * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** - * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies - * - * @param string|null $currency - * - * @return self + * The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies. */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * Date the invoice was issued. Defaults to today’s date. - * - * @return \DateTime|null */ - public function getIssueDate() : ?\DateTime + public function getIssueDate(): ?\DateTime { return $this->issueDate; } + /** * Date the invoice was issued. Defaults to today’s date. - * - * @param \DateTime|null $issueDate - * - * @return self */ - public function setIssueDate(?\DateTime $issueDate) : self + public function setIssueDate(?\DateTime $issueDate): self { $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. - * - * @return \DateTime|null */ - public function getDueDate() : ?\DateTime + public function getDueDate(): ?\DateTime { return $this->dueDate; } + /** * 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. - * - * @param \DateTime|null $dueDate - * - * @return self */ - public function setDueDate(?\DateTime $dueDate) : self + public function setDueDate(?\DateTime $dueDate): self { $this->dueDate = $dueDate; + return $this; } + /** * The timeframe in which the invoice should be paid. Defaults to custom. Options: upon receipt, net 15, net 30, net 45, net 60, or custom. - * - * @return string|null */ - public function getPaymentTerm() : ?string + public function getPaymentTerm(): ?string { return $this->paymentTerm; } + /** * The timeframe in which the invoice should be paid. Defaults to custom. Options: upon receipt, net 15, net 30, net 45, net 60, or custom. - * - * @param string|null $paymentTerm - * - * @return self */ - public function setPaymentTerm(?string $paymentTerm) : self + public function setPaymentTerm(?string $paymentTerm): self { $this->paymentTerm = $paymentTerm; + return $this; } + /** - * An line items import object - * - * @return InvoicesPostBodyLineItemsImport|null + * An line items import object. */ - public function getLineItemsImport() : ?InvoicesPostBodyLineItemsImport + public function getLineItemsImport(): ?InvoicesPostBodyLineItemsImport { return $this->lineItemsImport; } + /** - * An line items import object - * - * @param InvoicesPostBodyLineItemsImport|null $lineItemsImport - * - * @return self + * An line items import object. */ - public function setLineItemsImport(?InvoicesPostBodyLineItemsImport $lineItemsImport) : self + public function setLineItemsImport(?InvoicesPostBodyLineItemsImport $lineItemsImport): self { $this->lineItemsImport = $lineItemsImport; + return $this; } + /** - * Array of line item parameters + * Array of line item parameters. * * @return InvoicesPostBodyLineItemsItem[]|null */ - public function getLineItems() : ?array + public function getLineItems(): ?array { return $this->lineItems; } + /** - * Array of line item parameters + * Array of line item parameters. * * @param InvoicesPostBodyLineItemsItem[]|null $lineItems - * - * @return self */ - public function setLineItems(?array $lineItems) : self + public function setLineItems(?array $lineItems): self { $this->lineItems = $lineItems; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesPostBodyLineItemsImport.php b/generated/Model/InvoicesPostBodyLineItemsImport.php index 9c9ce90..5d9f6f6 100644 --- a/generated/Model/InvoicesPostBodyLineItemsImport.php +++ b/generated/Model/InvoicesPostBodyLineItemsImport.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesPostBodyLineItemsImport @@ -22,67 +31,62 @@ class InvoicesPostBodyLineItemsImport * @var InvoicesPostBodyLineItemsImportExpenses */ protected $expenses; + /** * An array of the client’s project IDs you’d like to include time/expenses from. * * @return int[] */ - public function getProjectIds() : array + public function getProjectIds(): array { return $this->projectIds; } + /** * An array of the client’s project IDs you’d like to include time/expenses from. * * @param int[] $projectIds - * - * @return self */ - public function setProjectIds(array $projectIds) : self + public function setProjectIds(array $projectIds): self { $this->projectIds = $projectIds; + return $this; } + /** * An time import object. - * - * @return InvoicesPostBodyLineItemsImportTime */ - public function getTime() : InvoicesPostBodyLineItemsImportTime + public function getTime(): InvoicesPostBodyLineItemsImportTime { return $this->time; } + /** * An time import object. - * - * @param InvoicesPostBodyLineItemsImportTime $time - * - * @return self */ - public function setTime(InvoicesPostBodyLineItemsImportTime $time) : self + public function setTime(InvoicesPostBodyLineItemsImportTime $time): self { $this->time = $time; + return $this; } + /** * An expense import object. - * - * @return InvoicesPostBodyLineItemsImportExpenses */ - public function getExpenses() : InvoicesPostBodyLineItemsImportExpenses + public function getExpenses(): InvoicesPostBodyLineItemsImportExpenses { return $this->expenses; } + /** * An expense import object. - * - * @param InvoicesPostBodyLineItemsImportExpenses $expenses - * - * @return self */ - public function setExpenses(InvoicesPostBodyLineItemsImportExpenses $expenses) : self + public function setExpenses(InvoicesPostBodyLineItemsImportExpenses $expenses): self { $this->expenses = $expenses; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php b/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php index 68ed07c..b046d11 100644 --- a/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php +++ b/generated/Model/InvoicesPostBodyLineItemsImportExpenses.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesPostBodyLineItemsImportExpenses @@ -28,88 +37,76 @@ class InvoicesPostBodyLineItemsImportExpenses * @var bool */ protected $attachReceipt; + /** * How to summarize the expenses per line item. Options: project, category, people, or detailed. - * - * @return string */ - public function getSummaryType() : string + public function getSummaryType(): string { return $this->summaryType; } + /** * How to summarize the expenses per line item. Options: project, category, people, or detailed. - * - * @param string $summaryType - * - * @return self */ - public function setSummaryType(string $summaryType) : self + public function setSummaryType(string $summaryType): self { $this->summaryType = $summaryType; + return $this; } + /** * Start date for included expenses. Must be provided if to is present. If neither from or to are provided, all unbilled expenses will be included. - * - * @return \DateTime */ - public function getFrom() : \DateTime + public function getFrom(): \DateTime { return $this->from; } + /** * Start date for included expenses. Must be provided if to is present. If neither from or to are provided, all unbilled expenses will be included. - * - * @param \DateTime $from - * - * @return self */ - public function setFrom(\DateTime $from) : self + public function setFrom(\DateTime $from): self { $this->from = $from; + return $this; } + /** * End date for included expenses. Must be provided if from is present. If neither from or to are provided, all unbilled expenses will be included. - * - * @return \DateTime */ - public function getTo() : \DateTime + public function getTo(): \DateTime { return $this->to; } + /** * End date for included expenses. Must be provided if from is present. If neither from or to are provided, all unbilled expenses will be included. - * - * @param \DateTime $to - * - * @return self */ - public function setTo(\DateTime $to) : self + public function setTo(\DateTime $to): self { $this->to = $to; + return $this; } + /** * If set to true, a PDF containing an expense report with receipts will be attached to the invoice. Defaults to false. - * - * @return bool */ - public function getAttachReceipt() : bool + public function getAttachReceipt(): bool { return $this->attachReceipt; } + /** * If set to true, a PDF containing an expense report with receipts will be attached to the invoice. Defaults to false. - * - * @param bool $attachReceipt - * - * @return self */ - public function setAttachReceipt(bool $attachReceipt) : self + public function setAttachReceipt(bool $attachReceipt): self { $this->attachReceipt = $attachReceipt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesPostBodyLineItemsImportTime.php b/generated/Model/InvoicesPostBodyLineItemsImportTime.php index 0d8ca09..f8397e4 100644 --- a/generated/Model/InvoicesPostBodyLineItemsImportTime.php +++ b/generated/Model/InvoicesPostBodyLineItemsImportTime.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesPostBodyLineItemsImportTime @@ -22,67 +31,58 @@ class InvoicesPostBodyLineItemsImportTime * @var \DateTime */ protected $to; + /** * How to summarize the time entries per line item. Options: project, task, people, or detailed. - * - * @return string */ - public function getSummaryType() : string + public function getSummaryType(): string { return $this->summaryType; } + /** * How to summarize the time entries per line item. Options: project, task, people, or detailed. - * - * @param string $summaryType - * - * @return self */ - public function setSummaryType(string $summaryType) : self + public function setSummaryType(string $summaryType): self { $this->summaryType = $summaryType; + return $this; } + /** * Start date for included time entries. Must be provided if to is present. If neither from or to are provided, all unbilled time entries will be included. - * - * @return \DateTime */ - public function getFrom() : \DateTime + public function getFrom(): \DateTime { return $this->from; } + /** * Start date for included time entries. Must be provided if to is present. If neither from or to are provided, all unbilled time entries will be included. - * - * @param \DateTime $from - * - * @return self */ - public function setFrom(\DateTime $from) : self + public function setFrom(\DateTime $from): self { $this->from = $from; + return $this; } + /** * End date for included time entries. Must be provided if from is present. If neither from or to are provided, all unbilled time entries will be included. - * - * @return \DateTime */ - public function getTo() : \DateTime + public function getTo(): \DateTime { return $this->to; } + /** * End date for included time entries. Must be provided if from is present. If neither from or to are provided, all unbilled time entries will be included. - * - * @param \DateTime $to - * - * @return self */ - public function setTo(\DateTime $to) : self + public function setTo(\DateTime $to): self { $this->to = $to; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/InvoicesPostBodyLineItemsItem.php b/generated/Model/InvoicesPostBodyLineItemsItem.php index ea468cc..637f0e1 100644 --- a/generated/Model/InvoicesPostBodyLineItemsItem.php +++ b/generated/Model/InvoicesPostBodyLineItemsItem.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class InvoicesPostBodyLineItemsItem @@ -46,151 +55,130 @@ class InvoicesPostBodyLineItemsItem * @var bool */ protected $taxed2; + /** * The ID of the project associated with this line item. - * - * @return int */ - public function getProjectId() : int + public function getProjectId(): int { return $this->projectId; } + /** * The ID of the project associated with this line item. - * - * @param int $projectId - * - * @return self */ - public function setProjectId(int $projectId) : self + public function setProjectId(int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The name of an invoice item category. - * - * @return string */ - public function getKind() : string + public function getKind(): string { return $this->kind; } + /** * The name of an invoice item category. - * - * @param string $kind - * - * @return self */ - public function setKind(string $kind) : self + public function setKind(string $kind): self { $this->kind = $kind; + return $this; } + /** * Text description of the line item. - * - * @return string */ - public function getDescription() : string + public function getDescription(): string { return $this->description; } + /** * Text description of the line item. - * - * @param string $description - * - * @return self */ - public function setDescription(string $description) : self + public function setDescription(string $description): self { $this->description = $description; + return $this; } + /** * The unit quantity of the item. Defaults to 1. - * - * @return float */ - public function getQuantity() : float + public function getQuantity(): float { return $this->quantity; } + /** * The unit quantity of the item. Defaults to 1. - * - * @param float $quantity - * - * @return self */ - public function setQuantity(float $quantity) : self + public function setQuantity(float $quantity): self { $this->quantity = $quantity; + return $this; } + /** * The individual price per unit. - * - * @return float */ - public function getUnitPrice() : float + public function getUnitPrice(): float { return $this->unitPrice; } + /** * The individual price per unit. - * - * @param float $unitPrice - * - * @return self */ - public function setUnitPrice(float $unitPrice) : self + public function setUnitPrice(float $unitPrice): self { $this->unitPrice = $unitPrice; + return $this; } + /** * Whether the invoice’s tax percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed() : bool + public function getTaxed(): bool { return $this->taxed; } + /** * Whether the invoice’s tax percentage applies to this line item. Defaults to false. - * - * @param bool $taxed - * - * @return self */ - public function setTaxed(bool $taxed) : self + public function setTaxed(bool $taxed): self { $this->taxed = $taxed; + return $this; } + /** * Whether the invoice’s tax2 percentage applies to this line item. Defaults to false. - * - * @return bool */ - public function getTaxed2() : bool + public function getTaxed2(): bool { return $this->taxed2; } + /** * Whether the invoice’s tax2 percentage applies to this line item. Defaults to false. - * - * @param bool $taxed2 - * - * @return self */ - public function setTaxed2(bool $taxed2) : self + public function setTaxed2(bool $taxed2): self { $this->taxed2 = $taxed2; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/PaginationLinks.php b/generated/Model/PaginationLinks.php index 06d06ec..f624381 100644 --- a/generated/Model/PaginationLinks.php +++ b/generated/Model/PaginationLinks.php @@ -1,115 +1,112 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class PaginationLinks { /** - * First page + * First page. * * @var string */ protected $first; /** - * Last page + * Last page. * * @var string */ protected $last; /** - * Previous page + * Previous page. * * @var string|null */ protected $previous; /** - * Next page + * Next page. * * @var string|null */ protected $next; + /** - * First page - * - * @return string + * First page. */ - public function getFirst() : string + public function getFirst(): string { return $this->first; } + /** - * First page - * - * @param string $first - * - * @return self + * First page. */ - public function setFirst(string $first) : self + public function setFirst(string $first): self { $this->first = $first; + return $this; } + /** - * Last page - * - * @return string + * Last page. */ - public function getLast() : string + public function getLast(): string { return $this->last; } + /** - * Last page - * - * @param string $last - * - * @return self + * Last page. */ - public function setLast(string $last) : self + public function setLast(string $last): self { $this->last = $last; + return $this; } + /** - * Previous page - * - * @return string|null + * Previous page. */ - public function getPrevious() : ?string + public function getPrevious(): ?string { return $this->previous; } + /** - * Previous page - * - * @param string|null $previous - * - * @return self + * Previous page. */ - public function setPrevious(?string $previous) : self + public function setPrevious(?string $previous): self { $this->previous = $previous; + return $this; } + /** - * Next page - * - * @return string|null + * Next page. */ - public function getNext() : ?string + public function getNext(): ?string { return $this->next; } + /** - * Next page - * - * @param string|null $next - * - * @return self + * Next page. */ - public function setNext(?string $next) : self + public function setNext(?string $next): self { $this->next = $next; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Project.php b/generated/Model/Project.php index fb578d3..6a88d1a 100644 --- a/generated/Model/Project.php +++ b/generated/Model/Project.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Project @@ -148,508 +157,436 @@ class Project * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the project. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the project. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing the project’s client id, name, and currency. - * - * @return ProjectClient|null */ - public function getClient() : ?ProjectClient + public function getClient(): ?ProjectClient { return $this->client; } + /** * An object containing the project’s client id, name, and currency. - * - * @param ProjectClient|null $client - * - * @return self */ - public function setClient(?ProjectClient $client) : self + public function setClient(?ProjectClient $client): self { $this->client = $client; + return $this; } + /** * Unique name for the project. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * Unique name for the project. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The code associated with the project. - * - * @return string|null */ - public function getCode() : ?string + public function getCode(): ?string { return $this->code; } + /** * The code associated with the project. - * - * @param string|null $code - * - * @return self */ - public function setCode(?string $code) : self + public function setCode(?string $code): self { $this->code = $code; + return $this; } + /** * Whether the project is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the project is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Whether the project is billable or not. - * - * @return bool|null */ - public function getIsBillable() : ?bool + public function getIsBillable(): ?bool { return $this->isBillable; } + /** * Whether the project is billable or not. - * - * @param bool|null $isBillable - * - * @return self */ - public function setIsBillable(?bool $isBillable) : self + public function setIsBillable(?bool $isBillable): self { $this->isBillable = $isBillable; + return $this; } + /** * Whether the project is a fixed-fee project or not. - * - * @return bool|null */ - public function getIsFixedFee() : ?bool + public function getIsFixedFee(): ?bool { return $this->isFixedFee; } + /** * Whether the project is a fixed-fee project or not. - * - * @param bool|null $isFixedFee - * - * @return self */ - public function setIsFixedFee(?bool $isFixedFee) : self + public function setIsFixedFee(?bool $isFixedFee): self { $this->isFixedFee = $isFixedFee; + return $this; } + /** * The method by which the project is invoiced. - * - * @return string|null */ - public function getBillBy() : ?string + public function getBillBy(): ?string { return $this->billBy; } + /** * The method by which the project is invoiced. - * - * @param string|null $billBy - * - * @return self */ - public function setBillBy(?string $billBy) : self + public function setBillBy(?string $billBy): self { $this->billBy = $billBy; + return $this; } + /** * Rate for projects billed by Project Hourly Rate. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Rate for projects billed by Project Hourly Rate. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * The budget in hours for the project when budgeting by time. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * The budget in hours for the project when budgeting by time. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * The method by which the project is budgeted. - * - * @return string|null */ - public function getBudgetBy() : ?string + public function getBudgetBy(): ?string { return $this->budgetBy; } + /** * The method by which the project is budgeted. - * - * @param string|null $budgetBy - * - * @return self */ - public function setBudgetBy(?string $budgetBy) : self + public function setBudgetBy(?string $budgetBy): self { $this->budgetBy = $budgetBy; + return $this; } + /** * Option to have the budget reset every month. - * - * @return bool|null */ - public function getBudgetIsMonthly() : ?bool + public function getBudgetIsMonthly(): ?bool { return $this->budgetIsMonthly; } + /** * Option to have the budget reset every month. - * - * @param bool|null $budgetIsMonthly - * - * @return self */ - public function setBudgetIsMonthly(?bool $budgetIsMonthly) : self + public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { $this->budgetIsMonthly = $budgetIsMonthly; + return $this; } + /** * Whether Project Managers should be notified when the project goes over budget. - * - * @return bool|null */ - public function getNotifyWhenOverBudget() : ?bool + public function getNotifyWhenOverBudget(): ?bool { return $this->notifyWhenOverBudget; } + /** * Whether Project Managers should be notified when the project goes over budget. - * - * @param bool|null $notifyWhenOverBudget - * - * @return self */ - public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget) : self + public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget): self { $this->notifyWhenOverBudget = $notifyWhenOverBudget; + return $this; } + /** * Percentage value used to trigger over budget email alerts. - * - * @return float|null */ - public function getOverBudgetNotificationPercentage() : ?float + public function getOverBudgetNotificationPercentage(): ?float { return $this->overBudgetNotificationPercentage; } + /** * Percentage value used to trigger over budget email alerts. - * - * @param float|null $overBudgetNotificationPercentage - * - * @return self */ - public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage) : self + public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage): self { $this->overBudgetNotificationPercentage = $overBudgetNotificationPercentage; + return $this; } + /** * Date of last over budget notification. If none have been sent, this will be null. - * - * @return \DateTime|null */ - public function getOverBudgetNotificationDate() : ?\DateTime + public function getOverBudgetNotificationDate(): ?\DateTime { return $this->overBudgetNotificationDate; } + /** * Date of last over budget notification. If none have been sent, this will be null. - * - * @param \DateTime|null $overBudgetNotificationDate - * - * @return self */ - public function setOverBudgetNotificationDate(?\DateTime $overBudgetNotificationDate) : self + public function setOverBudgetNotificationDate(?\DateTime $overBudgetNotificationDate): self { $this->overBudgetNotificationDate = $overBudgetNotificationDate; + return $this; } + /** * Option to show project budget to all employees. Does not apply to Total Project Fee projects. - * - * @return bool|null */ - public function getShowBudgetToAll() : ?bool + public function getShowBudgetToAll(): ?bool { return $this->showBudgetToAll; } + /** * Option to show project budget to all employees. Does not apply to Total Project Fee projects. - * - * @param bool|null $showBudgetToAll - * - * @return self */ - public function setShowBudgetToAll(?bool $showBudgetToAll) : self + public function setShowBudgetToAll(?bool $showBudgetToAll): self { $this->showBudgetToAll = $showBudgetToAll; + return $this; } + /** * The monetary budget for the project when budgeting by money. - * - * @return float|null */ - public function getCostBudget() : ?float + public function getCostBudget(): ?float { return $this->costBudget; } + /** * The monetary budget for the project when budgeting by money. - * - * @param float|null $costBudget - * - * @return self */ - public function setCostBudget(?float $costBudget) : self + public function setCostBudget(?float $costBudget): self { $this->costBudget = $costBudget; + return $this; } + /** * Option for budget of Total Project Fees projects to include tracked expenses. - * - * @return bool|null */ - public function getCostBudgetIncludeExpenses() : ?bool + public function getCostBudgetIncludeExpenses(): ?bool { return $this->costBudgetIncludeExpenses; } + /** * Option for budget of Total Project Fees projects to include tracked expenses. - * - * @param bool|null $costBudgetIncludeExpenses - * - * @return self */ - public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses) : self + public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses): self { $this->costBudgetIncludeExpenses = $costBudgetIncludeExpenses; + return $this; } + /** * The amount you plan to invoice for the project. Only used by fixed-fee projects. - * - * @return float|null */ - public function getFee() : ?float + public function getFee(): ?float { return $this->fee; } + /** * The amount you plan to invoice for the project. Only used by fixed-fee projects. - * - * @param float|null $fee - * - * @return self */ - public function setFee(?float $fee) : self + public function setFee(?float $fee): self { $this->fee = $fee; + return $this; } + /** * Project notes. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Project notes. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Date the project was started. - * - * @return \DateTime|null */ - public function getStartsOn() : ?\DateTime + public function getStartsOn(): ?\DateTime { return $this->startsOn; } + /** * Date the project was started. - * - * @param \DateTime|null $startsOn - * - * @return self */ - public function setStartsOn(?\DateTime $startsOn) : self + public function setStartsOn(?\DateTime $startsOn): self { $this->startsOn = $startsOn; + return $this; } + /** * Date the project will end. - * - * @return \DateTime|null */ - public function getEndsOn() : ?\DateTime + public function getEndsOn(): ?\DateTime { return $this->endsOn; } + /** * Date the project will end. - * - * @param \DateTime|null $endsOn - * - * @return self */ - public function setEndsOn(?\DateTime $endsOn) : self + public function setEndsOn(?\DateTime $endsOn): self { $this->endsOn = $endsOn; + return $this; } + /** * Date and time the project was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the project was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the project was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the project was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectAssignment.php b/generated/Model/ProjectAssignment.php index a8e08a6..7ef30b1 100644 --- a/generated/Model/ProjectAssignment.php +++ b/generated/Model/ProjectAssignment.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectAssignment @@ -70,235 +79,206 @@ class ProjectAssignment * @var TaskAssignment[]|null */ protected $taskAssignments; + /** * Unique ID for the project assignment. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the project assignment. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * Whether the project assignment is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the project assignment is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Determines if the user has Project Manager permissions for the project. - * - * @return bool|null */ - public function getIsProjectManager() : ?bool + public function getIsProjectManager(): ?bool { return $this->isProjectManager; } + /** * Determines if the user has Project Manager permissions for the project. - * - * @param bool|null $isProjectManager - * - * @return self */ - public function setIsProjectManager(?bool $isProjectManager) : self + public function setIsProjectManager(?bool $isProjectManager): self { $this->isProjectManager = $isProjectManager; + return $this; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. - * - * @return bool|null */ - public function getUseDefaultRates() : ?bool + public function getUseDefaultRates(): ?bool { return $this->useDefaultRates; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. - * - * @param bool|null $useDefaultRates - * - * @return self */ - public function setUseDefaultRates(?bool $useDefaultRates) : self + public function setUseDefaultRates(?bool $useDefaultRates): self { $this->useDefaultRates = $useDefaultRates; + return $this; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is person. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is person. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * Date and time the project assignment was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the project assignment was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the project assignment was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the project assignment was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } + /** * An object containing the assigned project id, name, and code. - * - * @return ProjectAssignmentProject|null */ - public function getProject() : ?ProjectAssignmentProject + public function getProject(): ?ProjectAssignmentProject { return $this->project; } + /** * An object containing the assigned project id, name, and code. - * - * @param ProjectAssignmentProject|null $project - * - * @return self */ - public function setProject(?ProjectAssignmentProject $project) : self + public function setProject(?ProjectAssignmentProject $project): self { $this->project = $project; + return $this; } + /** * An object containing the project’s client id and name. - * - * @return ProjectAssignmentClient|null */ - public function getClient() : ?ProjectAssignmentClient + public function getClient(): ?ProjectAssignmentClient { return $this->client; } + /** * An object containing the project’s client id and name. - * - * @param ProjectAssignmentClient|null $client - * - * @return self */ - public function setClient(?ProjectAssignmentClient $client) : self + public function setClient(?ProjectAssignmentClient $client): self { $this->client = $client; + return $this; } + /** * Array of task assignment objects associated with the project. * * @return TaskAssignment[]|null */ - public function getTaskAssignments() : ?array + public function getTaskAssignments(): ?array { return $this->taskAssignments; } + /** * Array of task assignment objects associated with the project. * * @param TaskAssignment[]|null $taskAssignments - * - * @return self */ - public function setTaskAssignments(?array $taskAssignments) : self + public function setTaskAssignments(?array $taskAssignments): self { $this->taskAssignments = $taskAssignments; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectAssignmentClient.php b/generated/Model/ProjectAssignmentClient.php index c840060..782df13 100644 --- a/generated/Model/ProjectAssignmentClient.php +++ b/generated/Model/ProjectAssignmentClient.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectAssignmentClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectAssignmentProject.php b/generated/Model/ProjectAssignmentProject.php index 589e8ed..29c68e7 100644 --- a/generated/Model/ProjectAssignmentProject.php +++ b/generated/Model/ProjectAssignmentProject.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectAssignmentProject { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $code; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCode() : ?string + + public function getCode(): ?string { return $this->code; } - /** - * - * - * @param string|null $code - * - * @return self - */ - public function setCode(?string $code) : self + + public function setCode(?string $code): self { $this->code = $code; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectAssignments.php b/generated/Model/ProjectAssignments.php index 54981d2..436b6c8 100644 --- a/generated/Model/ProjectAssignments.php +++ b/generated/Model/ProjectAssignments.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectAssignments { /** - * - * * @var ProjectAssignment[] */ protected $projectAssignments; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return ProjectAssignment[] */ - public function getProjectAssignments() : array + public function getProjectAssignments(): array { return $this->projectAssignments; } + /** - * - * * @param ProjectAssignment[] $projectAssignments - * - * @return self */ - public function setProjectAssignments(array $projectAssignments) : self + public function setProjectAssignments(array $projectAssignments): self { $this->projectAssignments = $projectAssignments; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectBudgetReportResult.php b/generated/Model/ProjectBudgetReportResult.php index edde65e..36dc607 100644 --- a/generated/Model/ProjectBudgetReportResult.php +++ b/generated/Model/ProjectBudgetReportResult.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectBudgetReportResult @@ -64,214 +73,184 @@ class ProjectBudgetReportResult * @var float|null */ protected $budgetRemaining; + /** * The ID of the client associated with this project. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client associated with this project. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The name of the client associated with this project. - * - * @return string|null */ - public function getClientName() : ?string + public function getClientName(): ?string { return $this->clientName; } + /** * The name of the client associated with this project. - * - * @param string|null $clientName - * - * @return self */ - public function setClientName(?string $clientName) : self + public function setClientName(?string $clientName): self { $this->clientName = $clientName; + return $this; } + /** * The ID of the project. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The name of the project. - * - * @return string|null */ - public function getProjectName() : ?string + public function getProjectName(): ?string { return $this->projectName; } + /** * The name of the project. - * - * @param string|null $projectName - * - * @return self */ - public function setProjectName(?string $projectName) : self + public function setProjectName(?string $projectName): self { $this->projectName = $projectName; + return $this; } + /** * Whether the budget is reset every month. - * - * @return bool|null */ - public function getBudgetIsMonthly() : ?bool + public function getBudgetIsMonthly(): ?bool { return $this->budgetIsMonthly; } + /** * Whether the budget is reset every month. - * - * @param bool|null $budgetIsMonthly - * - * @return self */ - public function setBudgetIsMonthly(?bool $budgetIsMonthly) : self + public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { $this->budgetIsMonthly = $budgetIsMonthly; + return $this; } + /** * The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget). - * - * @return string|null */ - public function getBudgetBy() : ?string + public function getBudgetBy(): ?string { return $this->budgetBy; } + /** * The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget). - * - * @param string|null $budgetBy - * - * @return self */ - public function setBudgetBy(?string $budgetBy) : self + public function setBudgetBy(?string $budgetBy): self { $this->budgetBy = $budgetBy; + return $this; } + /** * Whether the project is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the project is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * The budget in hours or money for the project when budgeting by time. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * The budget in hours or money for the project when budgeting by time. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * The total hours or money spent against the project’s budget. If Time Rounding is turned on, the hours will be rounded according to your settings. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @return float|null */ - public function getBudgetSpent() : ?float + public function getBudgetSpent(): ?float { return $this->budgetSpent; } + /** * The total hours or money spent against the project’s budget. If Time Rounding is turned on, the hours will be rounded according to your settings. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @param float|null $budgetSpent - * - * @return self */ - public function setBudgetSpent(?float $budgetSpent) : self + public function setBudgetSpent(?float $budgetSpent): self { $this->budgetSpent = $budgetSpent; + return $this; } + /** * The total hours or money remaining in the project’s budget. If Time Rounding is turned on, the hours will be rounded according to your settings. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @return float|null */ - public function getBudgetRemaining() : ?float + public function getBudgetRemaining(): ?float { return $this->budgetRemaining; } + /** * The total hours or money remaining in the project’s budget. If Time Rounding is turned on, the hours will be rounded according to your settings. If the project is budgeted by money, this value will only be visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @param float|null $budgetRemaining - * - * @return self */ - public function setBudgetRemaining(?float $budgetRemaining) : self + public function setBudgetRemaining(?float $budgetRemaining): self { $this->budgetRemaining = $budgetRemaining; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectBudgetReportResults.php b/generated/Model/ProjectBudgetReportResults.php index 7061790..f51051b 100644 --- a/generated/Model/ProjectBudgetReportResults.php +++ b/generated/Model/ProjectBudgetReportResults.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectBudgetReportResults { /** - * - * * @var ProjectBudgetReportResult[] */ protected $results; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return ProjectBudgetReportResult[] */ - public function getResults() : array + public function getResults(): array { return $this->results; } + /** - * - * * @param ProjectBudgetReportResult[] $results - * - * @return self */ - public function setResults(array $results) : self + public function setResults(array $results): self { $this->results = $results; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectClient.php b/generated/Model/ProjectClient.php index 6568c0a..233851a 100644 --- a/generated/Model/ProjectClient.php +++ b/generated/Model/ProjectClient.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $currency; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCurrency() : ?string + + public function getCurrency(): ?string { return $this->currency; } - /** - * - * - * @param string|null $currency - * - * @return self - */ - public function setCurrency(?string $currency) : self + + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Projects.php b/generated/Model/Projects.php index 0840a51..aa29c84 100644 --- a/generated/Model/Projects.php +++ b/generated/Model/Projects.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Projects { /** - * - * * @var Project[] */ protected $projects; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Project[] */ - public function getProjects() : array + public function getProjects(): array { return $this->projects; } + /** - * - * * @param Project[] $projects - * - * @return self */ - public function setProjects(array $projects) : self + public function setProjects(array $projects): self { $this->projects = $projects; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectsPostBody.php b/generated/Model/ProjectsPostBody.php index 0941421..8082dfd 100644 --- a/generated/Model/ProjectsPostBody.php +++ b/generated/Model/ProjectsPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectsPostBody @@ -124,424 +133,364 @@ class ProjectsPostBody * @var \DateTime|null */ protected $endsOn; + /** * The ID of the client to associate this project with. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client to associate this project with. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The name of the project. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the project. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The code associated with the project. - * - * @return string|null */ - public function getCode() : ?string + public function getCode(): ?string { return $this->code; } + /** * The code associated with the project. - * - * @param string|null $code - * - * @return self */ - public function setCode(?string $code) : self + public function setCode(?string $code): self { $this->code = $code; + return $this; } + /** * Whether the project is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the project is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Whether the project is billable or not. - * - * @return bool|null */ - public function getIsBillable() : ?bool + public function getIsBillable(): ?bool { return $this->isBillable; } + /** * Whether the project is billable or not. - * - * @param bool|null $isBillable - * - * @return self */ - public function setIsBillable(?bool $isBillable) : self + public function setIsBillable(?bool $isBillable): self { $this->isBillable = $isBillable; + return $this; } + /** * Whether the project is a fixed-fee project or not. - * - * @return bool|null */ - public function getIsFixedFee() : ?bool + public function getIsFixedFee(): ?bool { return $this->isFixedFee; } + /** * Whether the project is a fixed-fee project or not. - * - * @param bool|null $isFixedFee - * - * @return self */ - public function setIsFixedFee(?bool $isFixedFee) : self + public function setIsFixedFee(?bool $isFixedFee): self { $this->isFixedFee = $isFixedFee; + return $this; } + /** * The method by which the project is invoiced. Options: Project, Tasks, People, or none. - * - * @return string|null */ - public function getBillBy() : ?string + public function getBillBy(): ?string { return $this->billBy; } + /** * The method by which the project is invoiced. Options: Project, Tasks, People, or none. - * - * @param string|null $billBy - * - * @return self */ - public function setBillBy(?string $billBy) : self + public function setBillBy(?string $billBy): self { $this->billBy = $billBy; + return $this; } + /** * Rate for projects billed by Project Hourly Rate. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Rate for projects billed by Project Hourly Rate. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * The budget in hours for the project when budgeting by time. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * The budget in hours for the project when budgeting by time. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget). - * - * @return string|null */ - public function getBudgetBy() : ?string + public function getBudgetBy(): ?string { return $this->budgetBy; } + /** * The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget). - * - * @param string|null $budgetBy - * - * @return self */ - public function setBudgetBy(?string $budgetBy) : self + public function setBudgetBy(?string $budgetBy): self { $this->budgetBy = $budgetBy; + return $this; } + /** * Option to have the budget reset every month. Defaults to false. - * - * @return bool|null */ - public function getBudgetIsMonthly() : ?bool + public function getBudgetIsMonthly(): ?bool { return $this->budgetIsMonthly; } + /** * Option to have the budget reset every month. Defaults to false. - * - * @param bool|null $budgetIsMonthly - * - * @return self */ - public function setBudgetIsMonthly(?bool $budgetIsMonthly) : self + public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { $this->budgetIsMonthly = $budgetIsMonthly; + return $this; } + /** * Whether Project Managers should be notified when the project goes over budget. Defaults to false. - * - * @return bool|null */ - public function getNotifyWhenOverBudget() : ?bool + public function getNotifyWhenOverBudget(): ?bool { return $this->notifyWhenOverBudget; } + /** * Whether Project Managers should be notified when the project goes over budget. Defaults to false. - * - * @param bool|null $notifyWhenOverBudget - * - * @return self */ - public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget) : self + public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget): self { $this->notifyWhenOverBudget = $notifyWhenOverBudget; + return $this; } + /** * Percentage value used to trigger over budget email alerts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getOverBudgetNotificationPercentage() : ?float + public function getOverBudgetNotificationPercentage(): ?float { return $this->overBudgetNotificationPercentage; } + /** * Percentage value used to trigger over budget email alerts. Example: use 10.0 for 10.0%. - * - * @param float|null $overBudgetNotificationPercentage - * - * @return self */ - public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage) : self + public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage): self { $this->overBudgetNotificationPercentage = $overBudgetNotificationPercentage; + return $this; } + /** * Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false. - * - * @return bool|null */ - public function getShowBudgetToAll() : ?bool + public function getShowBudgetToAll(): ?bool { return $this->showBudgetToAll; } + /** * Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false. - * - * @param bool|null $showBudgetToAll - * - * @return self */ - public function setShowBudgetToAll(?bool $showBudgetToAll) : self + public function setShowBudgetToAll(?bool $showBudgetToAll): self { $this->showBudgetToAll = $showBudgetToAll; + return $this; } + /** * The monetary budget for the project when budgeting by money. - * - * @return float|null */ - public function getCostBudget() : ?float + public function getCostBudget(): ?float { return $this->costBudget; } + /** * The monetary budget for the project when budgeting by money. - * - * @param float|null $costBudget - * - * @return self */ - public function setCostBudget(?float $costBudget) : self + public function setCostBudget(?float $costBudget): self { $this->costBudget = $costBudget; + return $this; } + /** * Option for budget of Total Project Fees projects to include tracked expenses. Defaults to false. - * - * @return bool|null */ - public function getCostBudgetIncludeExpenses() : ?bool + public function getCostBudgetIncludeExpenses(): ?bool { return $this->costBudgetIncludeExpenses; } + /** * Option for budget of Total Project Fees projects to include tracked expenses. Defaults to false. - * - * @param bool|null $costBudgetIncludeExpenses - * - * @return self */ - public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses) : self + public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses): self { $this->costBudgetIncludeExpenses = $costBudgetIncludeExpenses; + return $this; } + /** * The amount you plan to invoice for the project. Only used by fixed-fee projects. - * - * @return float|null */ - public function getFee() : ?float + public function getFee(): ?float { return $this->fee; } + /** * The amount you plan to invoice for the project. Only used by fixed-fee projects. - * - * @param float|null $fee - * - * @return self */ - public function setFee(?float $fee) : self + public function setFee(?float $fee): self { $this->fee = $fee; + return $this; } + /** * Project notes. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Project notes. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Date the project was started. - * - * @return \DateTime|null */ - public function getStartsOn() : ?\DateTime + public function getStartsOn(): ?\DateTime { return $this->startsOn; } + /** * Date the project was started. - * - * @param \DateTime|null $startsOn - * - * @return self */ - public function setStartsOn(?\DateTime $startsOn) : self + public function setStartsOn(?\DateTime $startsOn): self { $this->startsOn = $startsOn; + return $this; } + /** * Date the project will end. - * - * @return \DateTime|null */ - public function getEndsOn() : ?\DateTime + public function getEndsOn(): ?\DateTime { return $this->endsOn; } + /** * Date the project will end. - * - * @param \DateTime|null $endsOn - * - * @return self */ - public function setEndsOn(?\DateTime $endsOn) : self + public function setEndsOn(?\DateTime $endsOn): self { $this->endsOn = $endsOn; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectsProjectIdPatchBody.php b/generated/Model/ProjectsProjectIdPatchBody.php index 3d73d85..30a6ce6 100644 --- a/generated/Model/ProjectsProjectIdPatchBody.php +++ b/generated/Model/ProjectsProjectIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectsProjectIdPatchBody @@ -124,424 +133,364 @@ class ProjectsProjectIdPatchBody * @var \DateTime|null */ protected $endsOn; + /** * The ID of the client to associate this project with. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client to associate this project with. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The name of the project. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the project. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The code associated with the project. - * - * @return string|null */ - public function getCode() : ?string + public function getCode(): ?string { return $this->code; } + /** * The code associated with the project. - * - * @param string|null $code - * - * @return self */ - public function setCode(?string $code) : self + public function setCode(?string $code): self { $this->code = $code; + return $this; } + /** * Whether the project is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the project is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Whether the project is billable or not. - * - * @return bool|null */ - public function getIsBillable() : ?bool + public function getIsBillable(): ?bool { return $this->isBillable; } + /** * Whether the project is billable or not. - * - * @param bool|null $isBillable - * - * @return self */ - public function setIsBillable(?bool $isBillable) : self + public function setIsBillable(?bool $isBillable): self { $this->isBillable = $isBillable; + return $this; } + /** * Whether the project is a fixed-fee project or not. - * - * @return bool|null */ - public function getIsFixedFee() : ?bool + public function getIsFixedFee(): ?bool { return $this->isFixedFee; } + /** * Whether the project is a fixed-fee project or not. - * - * @param bool|null $isFixedFee - * - * @return self */ - public function setIsFixedFee(?bool $isFixedFee) : self + public function setIsFixedFee(?bool $isFixedFee): self { $this->isFixedFee = $isFixedFee; + return $this; } + /** * The method by which the project is invoiced. Options: Project, Tasks, People, or none. - * - * @return string|null */ - public function getBillBy() : ?string + public function getBillBy(): ?string { return $this->billBy; } + /** * The method by which the project is invoiced. Options: Project, Tasks, People, or none. - * - * @param string|null $billBy - * - * @return self */ - public function setBillBy(?string $billBy) : self + public function setBillBy(?string $billBy): self { $this->billBy = $billBy; + return $this; } + /** * Rate for projects billed by Project Hourly Rate. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Rate for projects billed by Project Hourly Rate. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * The budget in hours for the project when budgeting by time. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * The budget in hours for the project when budgeting by time. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget). - * - * @return string|null */ - public function getBudgetBy() : ?string + public function getBudgetBy(): ?string { return $this->budgetBy; } + /** * The method by which the project is budgeted. Options: project (Hours Per Project), project_cost (Total Project Fees), task (Hours Per Task), task_fees (Fees Per Task), person (Hours Per Person), none (No Budget). - * - * @param string|null $budgetBy - * - * @return self */ - public function setBudgetBy(?string $budgetBy) : self + public function setBudgetBy(?string $budgetBy): self { $this->budgetBy = $budgetBy; + return $this; } + /** * Option to have the budget reset every month. Defaults to false. - * - * @return bool|null */ - public function getBudgetIsMonthly() : ?bool + public function getBudgetIsMonthly(): ?bool { return $this->budgetIsMonthly; } + /** * Option to have the budget reset every month. Defaults to false. - * - * @param bool|null $budgetIsMonthly - * - * @return self */ - public function setBudgetIsMonthly(?bool $budgetIsMonthly) : self + public function setBudgetIsMonthly(?bool $budgetIsMonthly): self { $this->budgetIsMonthly = $budgetIsMonthly; + return $this; } + /** * Whether Project Managers should be notified when the project goes over budget. Defaults to false. - * - * @return bool|null */ - public function getNotifyWhenOverBudget() : ?bool + public function getNotifyWhenOverBudget(): ?bool { return $this->notifyWhenOverBudget; } + /** * Whether Project Managers should be notified when the project goes over budget. Defaults to false. - * - * @param bool|null $notifyWhenOverBudget - * - * @return self */ - public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget) : self + public function setNotifyWhenOverBudget(?bool $notifyWhenOverBudget): self { $this->notifyWhenOverBudget = $notifyWhenOverBudget; + return $this; } + /** * Percentage value used to trigger over budget email alerts. Example: use 10.0 for 10.0%. - * - * @return float|null */ - public function getOverBudgetNotificationPercentage() : ?float + public function getOverBudgetNotificationPercentage(): ?float { return $this->overBudgetNotificationPercentage; } + /** * Percentage value used to trigger over budget email alerts. Example: use 10.0 for 10.0%. - * - * @param float|null $overBudgetNotificationPercentage - * - * @return self */ - public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage) : self + public function setOverBudgetNotificationPercentage(?float $overBudgetNotificationPercentage): self { $this->overBudgetNotificationPercentage = $overBudgetNotificationPercentage; + return $this; } + /** * Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false. - * - * @return bool|null */ - public function getShowBudgetToAll() : ?bool + public function getShowBudgetToAll(): ?bool { return $this->showBudgetToAll; } + /** * Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false. - * - * @param bool|null $showBudgetToAll - * - * @return self */ - public function setShowBudgetToAll(?bool $showBudgetToAll) : self + public function setShowBudgetToAll(?bool $showBudgetToAll): self { $this->showBudgetToAll = $showBudgetToAll; + return $this; } + /** * The monetary budget for the project when budgeting by money. - * - * @return float|null */ - public function getCostBudget() : ?float + public function getCostBudget(): ?float { return $this->costBudget; } + /** * The monetary budget for the project when budgeting by money. - * - * @param float|null $costBudget - * - * @return self */ - public function setCostBudget(?float $costBudget) : self + public function setCostBudget(?float $costBudget): self { $this->costBudget = $costBudget; + return $this; } + /** * Option for budget of Total Project Fees projects to include tracked expenses. Defaults to false. - * - * @return bool|null */ - public function getCostBudgetIncludeExpenses() : ?bool + public function getCostBudgetIncludeExpenses(): ?bool { return $this->costBudgetIncludeExpenses; } + /** * Option for budget of Total Project Fees projects to include tracked expenses. Defaults to false. - * - * @param bool|null $costBudgetIncludeExpenses - * - * @return self */ - public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses) : self + public function setCostBudgetIncludeExpenses(?bool $costBudgetIncludeExpenses): self { $this->costBudgetIncludeExpenses = $costBudgetIncludeExpenses; + return $this; } + /** * The amount you plan to invoice for the project. Only used by fixed-fee projects. - * - * @return float|null */ - public function getFee() : ?float + public function getFee(): ?float { return $this->fee; } + /** * The amount you plan to invoice for the project. Only used by fixed-fee projects. - * - * @param float|null $fee - * - * @return self */ - public function setFee(?float $fee) : self + public function setFee(?float $fee): self { $this->fee = $fee; + return $this; } + /** * Project notes. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Project notes. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Date the project was started. - * - * @return \DateTime|null */ - public function getStartsOn() : ?\DateTime + public function getStartsOn(): ?\DateTime { return $this->startsOn; } + /** * Date the project was started. - * - * @param \DateTime|null $startsOn - * - * @return self */ - public function setStartsOn(?\DateTime $startsOn) : self + public function setStartsOn(?\DateTime $startsOn): self { $this->startsOn = $startsOn; + return $this; } + /** * Date the project will end. - * - * @return \DateTime|null */ - public function getEndsOn() : ?\DateTime + public function getEndsOn(): ?\DateTime { return $this->endsOn; } + /** * Date the project will end. - * - * @param \DateTime|null $endsOn - * - * @return self */ - public function setEndsOn(?\DateTime $endsOn) : self + public function setEndsOn(?\DateTime $endsOn): self { $this->endsOn = $endsOn; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php b/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php index 414c0db..1aad18d 100644 --- a/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php +++ b/generated/Model/ProjectsProjectIdTaskAssignmentsPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectsProjectIdTaskAssignmentsPostBody @@ -34,109 +43,94 @@ class ProjectsProjectIdTaskAssignmentsPostBody * @var float|null */ protected $budget; + /** * The ID of the task to associate with the project. - * - * @return int|null */ - public function getTaskId() : ?int + public function getTaskId(): ?int { return $this->taskId; } + /** * The ID of the task to associate with the project. - * - * @param int|null $taskId - * - * @return self */ - public function setTaskId(?int $taskId) : self + public function setTaskId(?int $taskId): self { $this->taskId = $taskId; + return $this; } + /** * Whether the task assignment is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the task assignment is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Whether the task assignment is billable or not. Defaults to false. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether the task assignment is billable or not. Defaults to false. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * Rate used when the project’s bill_by is Tasks. Defaults to null when billing by task hourly rate, otherwise 0. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Rate used when the project’s bill_by is Tasks. Defaults to null when billing by task hourly rate, otherwise 0. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is task or task_fees. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is task or task_fees. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php b/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php index d6e00e1..c03567f 100644 --- a/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php +++ b/generated/Model/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody @@ -28,88 +37,76 @@ class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody * @var float|null */ protected $budget; + /** * Whether the task assignment is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the task assignment is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Whether the task assignment is billable or not. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether the task assignment is billable or not. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * Rate used when the project’s bill_by is Tasks. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Rate used when the project’s bill_by is Tasks. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is task or task_fees. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is task or task_fees. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php b/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php index 772abbd..25bdb21 100644 --- a/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php +++ b/generated/Model/ProjectsProjectIdUserAssignmentsPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectsProjectIdUserAssignmentsPostBody @@ -40,130 +49,112 @@ class ProjectsProjectIdUserAssignmentsPostBody * @var float|null */ protected $budget; + /** * The ID of the user to associate with the project. - * - * @return int|null */ - public function getUserId() : ?int + public function getUserId(): ?int { return $this->userId; } + /** * The ID of the user to associate with the project. - * - * @param int|null $userId - * - * @return self */ - public function setUserId(?int $userId) : self + public function setUserId(?int $userId): self { $this->userId = $userId; + return $this; } + /** * Whether the user assignment is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the user assignment is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Determines if the user has Project Manager permissions for the project. Defaults to false for users with Regular User permissions and true for those with Project Managers or Administrator permissions. - * - * @return bool|null */ - public function getIsProjectManager() : ?bool + public function getIsProjectManager(): ?bool { return $this->isProjectManager; } + /** * Determines if the user has Project Manager permissions for the project. Defaults to false for users with Regular User permissions and true for those with Project Managers or Administrator permissions. - * - * @param bool|null $isProjectManager - * - * @return self */ - public function setIsProjectManager(?bool $isProjectManager) : self + public function setIsProjectManager(?bool $isProjectManager): self { $this->isProjectManager = $isProjectManager; + return $this; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. Defaults to true. - * - * @return bool|null */ - public function getUseDefaultRates() : ?bool + public function getUseDefaultRates(): ?bool { return $this->useDefaultRates; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. Defaults to true. - * - * @param bool|null $useDefaultRates - * - * @return self */ - public function setUseDefaultRates(?bool $useDefaultRates) : self + public function setUseDefaultRates(?bool $useDefaultRates): self { $this->useDefaultRates = $useDefaultRates; + return $this; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. Defaults to 0. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. Defaults to 0. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is person. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is person. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php b/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php index 21caa70..80d4477 100644 --- a/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php +++ b/generated/Model/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody @@ -34,109 +43,94 @@ class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody * @var float|null */ protected $budget; + /** * Whether the user assignment is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the user assignment is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Determines if the user has Project Manager permissions for the project. - * - * @return bool|null */ - public function getIsProjectManager() : ?bool + public function getIsProjectManager(): ?bool { return $this->isProjectManager; } + /** * Determines if the user has Project Manager permissions for the project. - * - * @param bool|null $isProjectManager - * - * @return self */ - public function setIsProjectManager(?bool $isProjectManager) : self + public function setIsProjectManager(?bool $isProjectManager): self { $this->isProjectManager = $isProjectManager; + return $this; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. - * - * @return bool|null */ - public function getUseDefaultRates() : ?bool + public function getUseDefaultRates(): ?bool { return $this->useDefaultRates; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. - * - * @param bool|null $useDefaultRates - * - * @return self */ - public function setUseDefaultRates(?bool $useDefaultRates) : self + public function setUseDefaultRates(?bool $useDefaultRates): self { $this->useDefaultRates = $useDefaultRates; + return $this; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is person. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is person. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Role.php b/generated/Model/Role.php index a52af0e..2c8f9e6 100644 --- a/generated/Model/Role.php +++ b/generated/Model/Role.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Role @@ -34,109 +43,98 @@ class Role * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the role. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the role. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The name of the role. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the role. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The IDs of the users assigned to this role. * * @return int[]|null */ - public function getUserIds() : ?array + public function getUserIds(): ?array { return $this->userIds; } + /** * The IDs of the users assigned to this role. * * @param int[]|null $userIds - * - * @return self */ - public function setUserIds(?array $userIds) : self + public function setUserIds(?array $userIds): self { $this->userIds = $userIds; + return $this; } + /** * Date and time the role was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the role was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the role was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the role was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Roles.php b/generated/Model/Roles.php index 4f276d8..138be9d 100644 --- a/generated/Model/Roles.php +++ b/generated/Model/Roles.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Roles { /** - * - * * @var Role[] */ protected $roles; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Role[] */ - public function getRoles() : array + public function getRoles(): array { return $this->roles; } + /** - * - * * @param Role[] $roles - * - * @return self */ - public function setRoles(array $roles) : self + public function setRoles(array $roles): self { $this->roles = $roles; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/RolesPostBody.php b/generated/Model/RolesPostBody.php index 34979c9..04b4182 100644 --- a/generated/Model/RolesPostBody.php +++ b/generated/Model/RolesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class RolesPostBody @@ -16,46 +25,44 @@ class RolesPostBody * @var int[]|null */ protected $userIds; + /** * The name of the role. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the role. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The IDs of the users assigned to this role. * * @return int[]|null */ - public function getUserIds() : ?array + public function getUserIds(): ?array { return $this->userIds; } + /** * The IDs of the users assigned to this role. * * @param int[]|null $userIds - * - * @return self */ - public function setUserIds(?array $userIds) : self + public function setUserIds(?array $userIds): self { $this->userIds = $userIds; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/RolesRoleIdPatchBody.php b/generated/Model/RolesRoleIdPatchBody.php index 46a01f4..da95f84 100644 --- a/generated/Model/RolesRoleIdPatchBody.php +++ b/generated/Model/RolesRoleIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class RolesRoleIdPatchBody @@ -16,46 +25,44 @@ class RolesRoleIdPatchBody * @var int[]|null */ protected $userIds; + /** * The name of the role. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the role. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * The IDs of the users assigned to this role. * * @return int[]|null */ - public function getUserIds() : ?array + public function getUserIds(): ?array { return $this->userIds; } + /** * The IDs of the users assigned to this role. * * @param int[]|null $userIds - * - * @return self */ - public function setUserIds(?array $userIds) : self + public function setUserIds(?array $userIds): self { $this->userIds = $userIds; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Task.php b/generated/Model/Task.php index 7720c89..01f7dfd 100644 --- a/generated/Model/Task.php +++ b/generated/Model/Task.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Task @@ -52,172 +61,148 @@ class Task * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the task. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the task. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The name of the task. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the task. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Used in determining whether default tasks should be marked billable when creating a new project. - * - * @return bool|null */ - public function getBillableByDefault() : ?bool + public function getBillableByDefault(): ?bool { return $this->billableByDefault; } + /** * Used in determining whether default tasks should be marked billable when creating a new project. - * - * @param bool|null $billableByDefault - * - * @return self */ - public function setBillableByDefault(?bool $billableByDefault) : self + public function setBillableByDefault(?bool $billableByDefault): self { $this->billableByDefault = $billableByDefault; + return $this; } + /** * The hourly rate to use for this task when it is added to a project. - * - * @return float|null */ - public function getDefaultHourlyRate() : ?float + public function getDefaultHourlyRate(): ?float { return $this->defaultHourlyRate; } + /** * The hourly rate to use for this task when it is added to a project. - * - * @param float|null $defaultHourlyRate - * - * @return self */ - public function setDefaultHourlyRate(?float $defaultHourlyRate) : self + public function setDefaultHourlyRate(?float $defaultHourlyRate): self { $this->defaultHourlyRate = $defaultHourlyRate; + return $this; } + /** * Whether this task should be automatically added to future projects. - * - * @return bool|null */ - public function getIsDefault() : ?bool + public function getIsDefault(): ?bool { return $this->isDefault; } + /** * Whether this task should be automatically added to future projects. - * - * @param bool|null $isDefault - * - * @return self */ - public function setIsDefault(?bool $isDefault) : self + public function setIsDefault(?bool $isDefault): self { $this->isDefault = $isDefault; + return $this; } + /** * Whether this task is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether this task is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Date and time the task was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the task was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the task was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the task was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TaskAssignment.php b/generated/Model/TaskAssignment.php index 57a7d73..3bd8d34 100644 --- a/generated/Model/TaskAssignment.php +++ b/generated/Model/TaskAssignment.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TaskAssignment @@ -58,193 +67,166 @@ class TaskAssignment * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the task assignment. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the task assignment. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing the id, name, and code of the associated project. - * - * @return TaskAssignmentProject|null */ - public function getProject() : ?TaskAssignmentProject + public function getProject(): ?TaskAssignmentProject { return $this->project; } + /** * An object containing the id, name, and code of the associated project. - * - * @param TaskAssignmentProject|null $project - * - * @return self */ - public function setProject(?TaskAssignmentProject $project) : self + public function setProject(?TaskAssignmentProject $project): self { $this->project = $project; + return $this; } + /** * An object containing the id and name of the associated task. - * - * @return TaskAssignmentTask|null */ - public function getTask() : ?TaskAssignmentTask + public function getTask(): ?TaskAssignmentTask { return $this->task; } + /** * An object containing the id and name of the associated task. - * - * @param TaskAssignmentTask|null $task - * - * @return self */ - public function setTask(?TaskAssignmentTask $task) : self + public function setTask(?TaskAssignmentTask $task): self { $this->task = $task; + return $this; } + /** * Whether the task assignment is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the task assignment is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Whether the task assignment is billable or not. For example: if set to true, all time tracked on this project for the associated task will be marked as billable. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether the task assignment is billable or not. For example: if set to true, all time tracked on this project for the associated task will be marked as billable. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * Rate used when the project’s bill_by is Tasks. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Rate used when the project’s bill_by is Tasks. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is task or task_fees. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is task or task_fees. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * Date and time the task assignment was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the task assignment was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the task assignment was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the task assignment was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TaskAssignmentProject.php b/generated/Model/TaskAssignmentProject.php index 6d0fb80..74da9b3 100644 --- a/generated/Model/TaskAssignmentProject.php +++ b/generated/Model/TaskAssignmentProject.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TaskAssignmentProject { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $code; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCode() : ?string + + public function getCode(): ?string { return $this->code; } - /** - * - * - * @param string|null $code - * - * @return self - */ - public function setCode(?string $code) : self + + public function setCode(?string $code): self { $this->code = $code; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TaskAssignmentTask.php b/generated/Model/TaskAssignmentTask.php index 2b6493c..1cbd1ce 100644 --- a/generated/Model/TaskAssignmentTask.php +++ b/generated/Model/TaskAssignmentTask.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TaskAssignmentTask { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TaskAssignments.php b/generated/Model/TaskAssignments.php index c8f5d83..129855c 100644 --- a/generated/Model/TaskAssignments.php +++ b/generated/Model/TaskAssignments.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TaskAssignments { /** - * - * * @var TaskAssignment[] */ protected $taskAssignments; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return TaskAssignment[] */ - public function getTaskAssignments() : array + public function getTaskAssignments(): array { return $this->taskAssignments; } + /** - * - * * @param TaskAssignment[] $taskAssignments - * - * @return self */ - public function setTaskAssignments(array $taskAssignments) : self + public function setTaskAssignments(array $taskAssignments): self { $this->taskAssignments = $taskAssignments; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Tasks.php b/generated/Model/Tasks.php index 8902ca9..f189d06 100644 --- a/generated/Model/Tasks.php +++ b/generated/Model/Tasks.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Tasks { /** - * - * * @var Task[] */ protected $tasks; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return Task[] */ - public function getTasks() : array + public function getTasks(): array { return $this->tasks; } + /** - * - * * @param Task[] $tasks - * - * @return self */ - public function setTasks(array $tasks) : self + public function setTasks(array $tasks): self { $this->tasks = $tasks; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TasksPostBody.php b/generated/Model/TasksPostBody.php index 27f4057..f7594b1 100644 --- a/generated/Model/TasksPostBody.php +++ b/generated/Model/TasksPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TasksPostBody @@ -34,109 +43,94 @@ class TasksPostBody * @var bool|null */ protected $isActive; + /** * The name of the task. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the task. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Used in determining whether default tasks should be marked billable when creating a new project. Defaults to true. - * - * @return bool|null */ - public function getBillableByDefault() : ?bool + public function getBillableByDefault(): ?bool { return $this->billableByDefault; } + /** * Used in determining whether default tasks should be marked billable when creating a new project. Defaults to true. - * - * @param bool|null $billableByDefault - * - * @return self */ - public function setBillableByDefault(?bool $billableByDefault) : self + public function setBillableByDefault(?bool $billableByDefault): self { $this->billableByDefault = $billableByDefault; + return $this; } + /** * The default hourly rate to use for this task when it is added to a project. Defaults to 0. - * - * @return float|null */ - public function getDefaultHourlyRate() : ?float + public function getDefaultHourlyRate(): ?float { return $this->defaultHourlyRate; } + /** * The default hourly rate to use for this task when it is added to a project. Defaults to 0. - * - * @param float|null $defaultHourlyRate - * - * @return self */ - public function setDefaultHourlyRate(?float $defaultHourlyRate) : self + public function setDefaultHourlyRate(?float $defaultHourlyRate): self { $this->defaultHourlyRate = $defaultHourlyRate; + return $this; } + /** * Whether this task should be automatically added to future projects. Defaults to false. - * - * @return bool|null */ - public function getIsDefault() : ?bool + public function getIsDefault(): ?bool { return $this->isDefault; } + /** * Whether this task should be automatically added to future projects. Defaults to false. - * - * @param bool|null $isDefault - * - * @return self */ - public function setIsDefault(?bool $isDefault) : self + public function setIsDefault(?bool $isDefault): self { $this->isDefault = $isDefault; + return $this; } + /** * Whether this task is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether this task is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TasksTaskIdPatchBody.php b/generated/Model/TasksTaskIdPatchBody.php index 10cc4b6..f415443 100644 --- a/generated/Model/TasksTaskIdPatchBody.php +++ b/generated/Model/TasksTaskIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TasksTaskIdPatchBody @@ -34,109 +43,94 @@ class TasksTaskIdPatchBody * @var bool|null */ protected $isActive; + /** * The name of the task. - * - * @return string|null */ - public function getName() : ?string + public function getName(): ?string { return $this->name; } + /** * The name of the task. - * - * @param string|null $name - * - * @return self */ - public function setName(?string $name) : self + public function setName(?string $name): self { $this->name = $name; + return $this; } + /** * Used in determining whether default tasks should be marked billable when creating a new project. - * - * @return bool|null */ - public function getBillableByDefault() : ?bool + public function getBillableByDefault(): ?bool { return $this->billableByDefault; } + /** * Used in determining whether default tasks should be marked billable when creating a new project. - * - * @param bool|null $billableByDefault - * - * @return self */ - public function setBillableByDefault(?bool $billableByDefault) : self + public function setBillableByDefault(?bool $billableByDefault): self { $this->billableByDefault = $billableByDefault; + return $this; } + /** * The default hourly rate to use for this task when it is added to a project. - * - * @return float|null */ - public function getDefaultHourlyRate() : ?float + public function getDefaultHourlyRate(): ?float { return $this->defaultHourlyRate; } + /** * The default hourly rate to use for this task when it is added to a project. - * - * @param float|null $defaultHourlyRate - * - * @return self */ - public function setDefaultHourlyRate(?float $defaultHourlyRate) : self + public function setDefaultHourlyRate(?float $defaultHourlyRate): self { $this->defaultHourlyRate = $defaultHourlyRate; + return $this; } + /** * Whether this task should be automatically added to future projects. - * - * @return bool|null */ - public function getIsDefault() : ?bool + public function getIsDefault(): ?bool { return $this->isDefault; } + /** * Whether this task should be automatically added to future projects. - * - * @param bool|null $isDefault - * - * @return self */ - public function setIsDefault(?bool $isDefault) : self + public function setIsDefault(?bool $isDefault): self { $this->isDefault = $isDefault; + return $this; } + /** * Whether this task is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether this task is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntries.php b/generated/Model/TimeEntries.php index 418152d..fcd3602 100644 --- a/generated/Model/TimeEntries.php +++ b/generated/Model/TimeEntries.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntries { /** - * - * * @var TimeEntry[] */ protected $timeEntries; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return TimeEntry[] */ - public function getTimeEntries() : array + public function getTimeEntries(): array { return $this->timeEntries; } + /** - * - * * @param TimeEntry[] $timeEntries - * - * @return self */ - public function setTimeEntries(array $timeEntries) : self + public function setTimeEntries(array $timeEntries): self { $this->timeEntries = $timeEntries; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntriesPostBody.php b/generated/Model/TimeEntriesPostBody.php index 5993fe7..dab6978 100644 --- a/generated/Model/TimeEntriesPostBody.php +++ b/generated/Model/TimeEntriesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntriesPostBody @@ -58,193 +67,166 @@ class TimeEntriesPostBody * @var float|null */ protected $hours; + /** * The ID of the user to associate with the time entry. Defaults to the currently authenticated user’s ID. - * - * @return int|null */ - public function getUserId() : ?int + public function getUserId(): ?int { return $this->userId; } + /** * The ID of the user to associate with the time entry. Defaults to the currently authenticated user’s ID. - * - * @param int|null $userId - * - * @return self */ - public function setUserId(?int $userId) : self + public function setUserId(?int $userId): self { $this->userId = $userId; + return $this; } + /** * The ID of the project to associate with the time entry. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project to associate with the time entry. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The ID of the task to associate with the time entry. - * - * @return int|null */ - public function getTaskId() : ?int + public function getTaskId(): ?int { return $this->taskId; } + /** * The ID of the task to associate with the time entry. - * - * @param int|null $taskId - * - * @return self */ - public function setTaskId(?int $taskId) : self + public function setTaskId(?int $taskId): self { $this->taskId = $taskId; + return $this; } + /** * The ISO 8601 formatted date the time entry was spent. - * - * @return \DateTime|null */ - public function getSpentDate() : ?\DateTime + public function getSpentDate(): ?\DateTime { return $this->spentDate; } + /** * The ISO 8601 formatted date the time entry was spent. - * - * @param \DateTime|null $spentDate - * - * @return self */ - public function setSpentDate(?\DateTime $spentDate) : self + public function setSpentDate(?\DateTime $spentDate): self { $this->spentDate = $spentDate; + return $this; } + /** * The time the entry started. Defaults to the current time. Example: “8:00am”. - * - * @return string|null */ - public function getStartedTime() : ?string + public function getStartedTime(): ?string { return $this->startedTime; } + /** * The time the entry started. Defaults to the current time. Example: “8:00am”. - * - * @param string|null $startedTime - * - * @return self */ - public function setStartedTime(?string $startedTime) : self + public function setStartedTime(?string $startedTime): self { $this->startedTime = $startedTime; + return $this; } + /** * The time the entry ended. If provided, is_running will be set to false. If not provided, is_running will be set to true. - * - * @return string|null */ - public function getEndedTime() : ?string + public function getEndedTime(): ?string { return $this->endedTime; } + /** * The time the entry ended. If provided, is_running will be set to false. If not provided, is_running will be set to true. - * - * @param string|null $endedTime - * - * @return self */ - public function setEndedTime(?string $endedTime) : self + public function setEndedTime(?string $endedTime): self { $this->endedTime = $endedTime; + return $this; } + /** * Any notes to be associated with the time entry. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any notes to be associated with the time entry. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * An object containing the id, group_id, account_id, and permalink of the external reference. - * - * @return TimeEntriesPostBodyExternalReference|null */ - public function getExternalReference() : ?TimeEntriesPostBodyExternalReference + public function getExternalReference(): ?TimeEntriesPostBodyExternalReference { return $this->externalReference; } + /** * An object containing the id, group_id, account_id, and permalink of the external reference. - * - * @param TimeEntriesPostBodyExternalReference|null $externalReference - * - * @return self */ - public function setExternalReference(?TimeEntriesPostBodyExternalReference $externalReference) : self + public function setExternalReference(?TimeEntriesPostBodyExternalReference $externalReference): self { $this->externalReference = $externalReference; + return $this; } + /** * The current amount of time tracked. If provided, the time entry will be created with the specified hours and is_running will be set to false. If not provided, hours will be set to 0.0 and is_running will be set to true. - * - * @return float|null */ - public function getHours() : ?float + public function getHours(): ?float { return $this->hours; } + /** * The current amount of time tracked. If provided, the time entry will be created with the specified hours and is_running will be set to false. If not provided, hours will be set to 0.0 and is_running will be set to true. - * - * @param float|null $hours - * - * @return self */ - public function setHours(?float $hours) : self + public function setHours(?float $hours): self { $this->hours = $hours; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntriesPostBodyExternalReference.php b/generated/Model/TimeEntriesPostBodyExternalReference.php index d806d8a..5c462ca 100644 --- a/generated/Model/TimeEntriesPostBodyExternalReference.php +++ b/generated/Model/TimeEntriesPostBodyExternalReference.php @@ -1,115 +1,80 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntriesPostBodyExternalReference { /** - * - * * @var string|null */ protected $id; /** - * - * * @var string|null */ protected $groupId; /** - * - * * @var string|null */ protected $accountId; /** - * - * * @var string|null */ protected $permalink; - /** - * - * - * @return string|null - */ - public function getId() : ?string + + public function getId(): ?string { return $this->id; } - /** - * - * - * @param string|null $id - * - * @return self - */ - public function setId(?string $id) : self + + public function setId(?string $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getGroupId() : ?string + + public function getGroupId(): ?string { return $this->groupId; } - /** - * - * - * @param string|null $groupId - * - * @return self - */ - public function setGroupId(?string $groupId) : self + + public function setGroupId(?string $groupId): self { $this->groupId = $groupId; + return $this; } - /** - * - * - * @return string|null - */ - public function getAccountId() : ?string + + public function getAccountId(): ?string { return $this->accountId; } - /** - * - * - * @param string|null $accountId - * - * @return self - */ - public function setAccountId(?string $accountId) : self + + public function setAccountId(?string $accountId): self { $this->accountId = $accountId; + return $this; } - /** - * - * - * @return string|null - */ - public function getPermalink() : ?string + + public function getPermalink(): ?string { return $this->permalink; } - /** - * - * - * @param string|null $permalink - * - * @return self - */ - public function setPermalink(?string $permalink) : self + + public function setPermalink(?string $permalink): self { $this->permalink = $permalink; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntriesTimeEntryIdPatchBody.php b/generated/Model/TimeEntriesTimeEntryIdPatchBody.php index 4cd2dec..f46c3e2 100644 --- a/generated/Model/TimeEntriesTimeEntryIdPatchBody.php +++ b/generated/Model/TimeEntriesTimeEntryIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntriesTimeEntryIdPatchBody @@ -52,172 +61,148 @@ class TimeEntriesTimeEntryIdPatchBody * @var TimeEntriesTimeEntryIdPatchBodyExternalReference|null */ protected $externalReference; + /** * The ID of the project to associate with the time entry. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project to associate with the time entry. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The ID of the task to associate with the time entry. - * - * @return int|null */ - public function getTaskId() : ?int + public function getTaskId(): ?int { return $this->taskId; } + /** * The ID of the task to associate with the time entry. - * - * @param int|null $taskId - * - * @return self */ - public function setTaskId(?int $taskId) : self + public function setTaskId(?int $taskId): self { $this->taskId = $taskId; + return $this; } + /** * The ISO 8601 formatted date the time entry was spent. - * - * @return \DateTime|null */ - public function getSpentDate() : ?\DateTime + public function getSpentDate(): ?\DateTime { return $this->spentDate; } + /** * The ISO 8601 formatted date the time entry was spent. - * - * @param \DateTime|null $spentDate - * - * @return self */ - public function setSpentDate(?\DateTime $spentDate) : self + public function setSpentDate(?\DateTime $spentDate): self { $this->spentDate = $spentDate; + return $this; } + /** * The time the entry started. Defaults to the current time. Example: “8:00am”. - * - * @return string|null */ - public function getStartedTime() : ?string + public function getStartedTime(): ?string { return $this->startedTime; } + /** * The time the entry started. Defaults to the current time. Example: “8:00am”. - * - * @param string|null $startedTime - * - * @return self */ - public function setStartedTime(?string $startedTime) : self + public function setStartedTime(?string $startedTime): self { $this->startedTime = $startedTime; + return $this; } + /** * The time the entry ended. - * - * @return string|null */ - public function getEndedTime() : ?string + public function getEndedTime(): ?string { return $this->endedTime; } + /** * The time the entry ended. - * - * @param string|null $endedTime - * - * @return self */ - public function setEndedTime(?string $endedTime) : self + public function setEndedTime(?string $endedTime): self { $this->endedTime = $endedTime; + return $this; } + /** * The current amount of time tracked. - * - * @return float|null */ - public function getHours() : ?float + public function getHours(): ?float { return $this->hours; } + /** * The current amount of time tracked. - * - * @param float|null $hours - * - * @return self */ - public function setHours(?float $hours) : self + public function setHours(?float $hours): self { $this->hours = $hours; + return $this; } + /** * Any notes to be associated with the time entry. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Any notes to be associated with the time entry. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * An object containing the id, group_id, account_id, and permalink of the external reference. - * - * @return TimeEntriesTimeEntryIdPatchBodyExternalReference|null */ - public function getExternalReference() : ?TimeEntriesTimeEntryIdPatchBodyExternalReference + public function getExternalReference(): ?TimeEntriesTimeEntryIdPatchBodyExternalReference { return $this->externalReference; } + /** * An object containing the id, group_id, account_id, and permalink of the external reference. - * - * @param TimeEntriesTimeEntryIdPatchBodyExternalReference|null $externalReference - * - * @return self */ - public function setExternalReference(?TimeEntriesTimeEntryIdPatchBodyExternalReference $externalReference) : self + public function setExternalReference(?TimeEntriesTimeEntryIdPatchBodyExternalReference $externalReference): self { $this->externalReference = $externalReference; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php b/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php index 7de2843..a876b4e 100644 --- a/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php +++ b/generated/Model/TimeEntriesTimeEntryIdPatchBodyExternalReference.php @@ -1,115 +1,80 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntriesTimeEntryIdPatchBodyExternalReference { /** - * - * * @var string|null */ protected $id; /** - * - * * @var string|null */ protected $groupId; /** - * - * * @var string|null */ protected $accountId; /** - * - * * @var string|null */ protected $permalink; - /** - * - * - * @return string|null - */ - public function getId() : ?string + + public function getId(): ?string { return $this->id; } - /** - * - * - * @param string|null $id - * - * @return self - */ - public function setId(?string $id) : self + + public function setId(?string $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getGroupId() : ?string + + public function getGroupId(): ?string { return $this->groupId; } - /** - * - * - * @param string|null $groupId - * - * @return self - */ - public function setGroupId(?string $groupId) : self + + public function setGroupId(?string $groupId): self { $this->groupId = $groupId; + return $this; } - /** - * - * - * @return string|null - */ - public function getAccountId() : ?string + + public function getAccountId(): ?string { return $this->accountId; } - /** - * - * - * @param string|null $accountId - * - * @return self - */ - public function setAccountId(?string $accountId) : self + + public function setAccountId(?string $accountId): self { $this->accountId = $accountId; + return $this; } - /** - * - * - * @return string|null - */ - public function getPermalink() : ?string + + public function getPermalink(): ?string { return $this->permalink; } - /** - * - * - * @param string|null $permalink - * - * @return self - */ - public function setPermalink(?string $permalink) : self + + public function setPermalink(?string $permalink): self { $this->permalink = $permalink; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntry.php b/generated/Model/TimeEntry.php index 4430eca..3674f3f 100644 --- a/generated/Model/TimeEntry.php +++ b/generated/Model/TimeEntry.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntry @@ -23,8 +32,6 @@ class TimeEntry */ protected $user; /** - * - * * @var UserAssignment */ protected $userAssignment; @@ -47,8 +54,6 @@ class TimeEntry */ protected $task; /** - * - * * @var TaskAssignment */ protected $taskAssignment; @@ -172,592 +177,496 @@ class TimeEntry * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the time entry. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the time entry. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * Date of the time entry. - * - * @return \DateTime|null */ - public function getSpentDate() : ?\DateTime + public function getSpentDate(): ?\DateTime { return $this->spentDate; } + /** * Date of the time entry. - * - * @param \DateTime|null $spentDate - * - * @return self */ - public function setSpentDate(?\DateTime $spentDate) : self + public function setSpentDate(?\DateTime $spentDate): self { $this->spentDate = $spentDate; + return $this; } + /** * An object containing the id and name of the associated user. - * - * @return TimeEntryUser|null */ - public function getUser() : ?TimeEntryUser + public function getUser(): ?TimeEntryUser { return $this->user; } + /** * An object containing the id and name of the associated user. - * - * @param TimeEntryUser|null $user - * - * @return self */ - public function setUser(?TimeEntryUser $user) : self + public function setUser(?TimeEntryUser $user): self { $this->user = $user; + return $this; } - /** - * - * - * @return UserAssignment - */ - public function getUserAssignment() : UserAssignment + + public function getUserAssignment(): UserAssignment { return $this->userAssignment; } - /** - * - * - * @param UserAssignment $userAssignment - * - * @return self - */ - public function setUserAssignment(UserAssignment $userAssignment) : self + + public function setUserAssignment(UserAssignment $userAssignment): self { $this->userAssignment = $userAssignment; + return $this; } + /** * An object containing the id and name of the associated client. - * - * @return TimeEntryClient|null */ - public function getClient() : ?TimeEntryClient + public function getClient(): ?TimeEntryClient { return $this->client; } + /** * An object containing the id and name of the associated client. - * - * @param TimeEntryClient|null $client - * - * @return self */ - public function setClient(?TimeEntryClient $client) : self + public function setClient(?TimeEntryClient $client): self { $this->client = $client; + return $this; } + /** * An object containing the id and name of the associated project. - * - * @return TimeEntryProject|null */ - public function getProject() : ?TimeEntryProject + public function getProject(): ?TimeEntryProject { return $this->project; } + /** * An object containing the id and name of the associated project. - * - * @param TimeEntryProject|null $project - * - * @return self */ - public function setProject(?TimeEntryProject $project) : self + public function setProject(?TimeEntryProject $project): self { $this->project = $project; + return $this; } + /** * An object containing the id and name of the associated task. - * - * @return TimeEntryTask|null */ - public function getTask() : ?TimeEntryTask + public function getTask(): ?TimeEntryTask { return $this->task; } + /** * An object containing the id and name of the associated task. - * - * @param TimeEntryTask|null $task - * - * @return self */ - public function setTask(?TimeEntryTask $task) : self + public function setTask(?TimeEntryTask $task): self { $this->task = $task; + return $this; } - /** - * - * - * @return TaskAssignment - */ - public function getTaskAssignment() : TaskAssignment + + public function getTaskAssignment(): TaskAssignment { return $this->taskAssignment; } - /** - * - * - * @param TaskAssignment $taskAssignment - * - * @return self - */ - public function setTaskAssignment(TaskAssignment $taskAssignment) : self + + public function setTaskAssignment(TaskAssignment $taskAssignment): self { $this->taskAssignment = $taskAssignment; + return $this; } + /** * An object containing the id, group_id, account_id, permalink, service, and service_icon_url of the associated external reference. - * - * @return TimeEntryExternalReference|null */ - public function getExternalReference() : ?TimeEntryExternalReference + public function getExternalReference(): ?TimeEntryExternalReference { return $this->externalReference; } + /** * An object containing the id, group_id, account_id, permalink, service, and service_icon_url of the associated external reference. - * - * @param TimeEntryExternalReference|null $externalReference - * - * @return self */ - public function setExternalReference(?TimeEntryExternalReference $externalReference) : self + public function setExternalReference(?TimeEntryExternalReference $externalReference): self { $this->externalReference = $externalReference; + return $this; } + /** * Once the time entry has been invoiced, this field will include the associated invoice’s id and number. - * - * @return TimeEntryInvoice|null */ - public function getInvoice() : ?TimeEntryInvoice + public function getInvoice(): ?TimeEntryInvoice { return $this->invoice; } + /** * Once the time entry has been invoiced, this field will include the associated invoice’s id and number. - * - * @param TimeEntryInvoice|null $invoice - * - * @return self */ - public function setInvoice(?TimeEntryInvoice $invoice) : self + public function setInvoice(?TimeEntryInvoice $invoice): self { $this->invoice = $invoice; + return $this; } + /** * Number of (decimal time) hours tracked in this time entry. - * - * @return float|null */ - public function getHours() : ?float + public function getHours(): ?float { return $this->hours; } + /** * Number of (decimal time) hours tracked in this time entry. - * - * @param float|null $hours - * - * @return self */ - public function setHours(?float $hours) : self + public function setHours(?float $hours): self { $this->hours = $hours; + return $this; } + /** * Number of (decimal time) hours already tracked in this time entry, before the timer was last started. - * - * @return float|null */ - public function getHoursWithoutTimer() : ?float + public function getHoursWithoutTimer(): ?float { return $this->hoursWithoutTimer; } + /** * Number of (decimal time) hours already tracked in this time entry, before the timer was last started. - * - * @param float|null $hoursWithoutTimer - * - * @return self */ - public function setHoursWithoutTimer(?float $hoursWithoutTimer) : self + public function setHoursWithoutTimer(?float $hoursWithoutTimer): self { $this->hoursWithoutTimer = $hoursWithoutTimer; + return $this; } + /** * Number of (decimal time) hours tracked in this time entry used in summary reports and invoices. This value is rounded according to the Time Rounding setting in your Preferences. - * - * @return float|null */ - public function getRoundedHours() : ?float + public function getRoundedHours(): ?float { return $this->roundedHours; } + /** * Number of (decimal time) hours tracked in this time entry used in summary reports and invoices. This value is rounded according to the Time Rounding setting in your Preferences. - * - * @param float|null $roundedHours - * - * @return self */ - public function setRoundedHours(?float $roundedHours) : self + public function setRoundedHours(?float $roundedHours): self { $this->roundedHours = $roundedHours; + return $this; } + /** * Notes attached to the time entry. - * - * @return string|null */ - public function getNotes() : ?string + public function getNotes(): ?string { return $this->notes; } + /** * Notes attached to the time entry. - * - * @param string|null $notes - * - * @return self */ - public function setNotes(?string $notes) : self + public function setNotes(?string $notes): self { $this->notes = $notes; + return $this; } + /** * Whether or not the time entry has been locked. - * - * @return bool|null */ - public function getIsLocked() : ?bool + public function getIsLocked(): ?bool { return $this->isLocked; } + /** * Whether or not the time entry has been locked. - * - * @param bool|null $isLocked - * - * @return self */ - public function setIsLocked(?bool $isLocked) : self + public function setIsLocked(?bool $isLocked): self { $this->isLocked = $isLocked; + return $this; } + /** * Why the time entry has been locked. - * - * @return string|null */ - public function getLockedReason() : ?string + public function getLockedReason(): ?string { return $this->lockedReason; } + /** * Why the time entry has been locked. - * - * @param string|null $lockedReason - * - * @return self */ - public function setLockedReason(?string $lockedReason) : self + public function setLockedReason(?string $lockedReason): self { $this->lockedReason = $lockedReason; + return $this; } + /** * Whether or not the time entry has been approved via Timesheet Approval. - * - * @return bool|null */ - public function getIsClosed() : ?bool + public function getIsClosed(): ?bool { return $this->isClosed; } + /** * Whether or not the time entry has been approved via Timesheet Approval. - * - * @param bool|null $isClosed - * - * @return self */ - public function setIsClosed(?bool $isClosed) : self + public function setIsClosed(?bool $isClosed): self { $this->isClosed = $isClosed; + return $this; } + /** * Whether or not the time entry has been marked as invoiced. - * - * @return bool|null */ - public function getIsBilled() : ?bool + public function getIsBilled(): ?bool { return $this->isBilled; } + /** * Whether or not the time entry has been marked as invoiced. - * - * @param bool|null $isBilled - * - * @return self */ - public function setIsBilled(?bool $isBilled) : self + public function setIsBilled(?bool $isBilled): self { $this->isBilled = $isBilled; + return $this; } + /** * Date and time the timer was started (if tracking by duration). Use the ISO 8601 Format. - * - * @return \DateTime|null */ - public function getTimerStartedAt() : ?\DateTime + public function getTimerStartedAt(): ?\DateTime { return $this->timerStartedAt; } + /** * Date and time the timer was started (if tracking by duration). Use the ISO 8601 Format. - * - * @param \DateTime|null $timerStartedAt - * - * @return self */ - public function setTimerStartedAt(?\DateTime $timerStartedAt) : self + public function setTimerStartedAt(?\DateTime $timerStartedAt): self { $this->timerStartedAt = $timerStartedAt; + return $this; } + /** * Time the time entry was started (if tracking by start/end times). - * - * @return string|null */ - public function getStartedTime() : ?string + public function getStartedTime(): ?string { return $this->startedTime; } + /** * Time the time entry was started (if tracking by start/end times). - * - * @param string|null $startedTime - * - * @return self */ - public function setStartedTime(?string $startedTime) : self + public function setStartedTime(?string $startedTime): self { $this->startedTime = $startedTime; + return $this; } + /** * Time the time entry was ended (if tracking by start/end times). - * - * @return string|null */ - public function getEndedTime() : ?string + public function getEndedTime(): ?string { return $this->endedTime; } + /** * Time the time entry was ended (if tracking by start/end times). - * - * @param string|null $endedTime - * - * @return self */ - public function setEndedTime(?string $endedTime) : self + public function setEndedTime(?string $endedTime): self { $this->endedTime = $endedTime; + return $this; } + /** * Whether or not the time entry is currently running. - * - * @return bool|null */ - public function getIsRunning() : ?bool + public function getIsRunning(): ?bool { return $this->isRunning; } + /** * Whether or not the time entry is currently running. - * - * @param bool|null $isRunning - * - * @return self */ - public function setIsRunning(?bool $isRunning) : self + public function setIsRunning(?bool $isRunning): self { $this->isRunning = $isRunning; + return $this; } + /** * Whether or not the time entry is billable. - * - * @return bool|null */ - public function getBillable() : ?bool + public function getBillable(): ?bool { return $this->billable; } + /** * Whether or not the time entry is billable. - * - * @param bool|null $billable - * - * @return self */ - public function setBillable(?bool $billable) : self + public function setBillable(?bool $billable): self { $this->billable = $billable; + return $this; } + /** * Whether or not the time entry counts towards the project budget. - * - * @return bool|null */ - public function getBudgeted() : ?bool + public function getBudgeted(): ?bool { return $this->budgeted; } + /** * Whether or not the time entry counts towards the project budget. - * - * @param bool|null $budgeted - * - * @return self */ - public function setBudgeted(?bool $budgeted) : self + public function setBudgeted(?bool $budgeted): self { $this->budgeted = $budgeted; + return $this; } + /** * The billable rate for the time entry. - * - * @return float|null */ - public function getBillableRate() : ?float + public function getBillableRate(): ?float { return $this->billableRate; } + /** * The billable rate for the time entry. - * - * @param float|null $billableRate - * - * @return self */ - public function setBillableRate(?float $billableRate) : self + public function setBillableRate(?float $billableRate): self { $this->billableRate = $billableRate; + return $this; } + /** * The cost rate for the time entry. - * - * @return float|null */ - public function getCostRate() : ?float + public function getCostRate(): ?float { return $this->costRate; } + /** * The cost rate for the time entry. - * - * @param float|null $costRate - * - * @return self */ - public function setCostRate(?float $costRate) : self + public function setCostRate(?float $costRate): self { $this->costRate = $costRate; + return $this; } + /** * Date and time the time entry was created. Use the ISO 8601 Format. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the time entry was created. Use the ISO 8601 Format. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the time entry was last updated. Use the ISO 8601 Format. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the time entry was last updated. Use the ISO 8601 Format. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntryClient.php b/generated/Model/TimeEntryClient.php index 3721b7d..01b64ab 100644 --- a/generated/Model/TimeEntryClient.php +++ b/generated/Model/TimeEntryClient.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntryClient { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntryExternalReference.php b/generated/Model/TimeEntryExternalReference.php index dfab6f3..63eda98 100644 --- a/generated/Model/TimeEntryExternalReference.php +++ b/generated/Model/TimeEntryExternalReference.php @@ -1,169 +1,112 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntryExternalReference { /** - * - * * @var string|null */ protected $id; /** - * - * * @var string|null */ protected $groupId; /** - * - * * @var string|null */ protected $accountId; /** - * - * * @var string|null */ protected $permalink; /** - * - * * @var string|null */ protected $service; /** - * - * * @var string|null */ protected $serviceIconUrl; - /** - * - * - * @return string|null - */ - public function getId() : ?string + + public function getId(): ?string { return $this->id; } - /** - * - * - * @param string|null $id - * - * @return self - */ - public function setId(?string $id) : self + + public function setId(?string $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getGroupId() : ?string + + public function getGroupId(): ?string { return $this->groupId; } - /** - * - * - * @param string|null $groupId - * - * @return self - */ - public function setGroupId(?string $groupId) : self + + public function setGroupId(?string $groupId): self { $this->groupId = $groupId; + return $this; } - /** - * - * - * @return string|null - */ - public function getAccountId() : ?string + + public function getAccountId(): ?string { return $this->accountId; } - /** - * - * - * @param string|null $accountId - * - * @return self - */ - public function setAccountId(?string $accountId) : self + + public function setAccountId(?string $accountId): self { $this->accountId = $accountId; + return $this; } - /** - * - * - * @return string|null - */ - public function getPermalink() : ?string + + public function getPermalink(): ?string { return $this->permalink; } - /** - * - * - * @param string|null $permalink - * - * @return self - */ - public function setPermalink(?string $permalink) : self + + public function setPermalink(?string $permalink): self { $this->permalink = $permalink; + return $this; } - /** - * - * - * @return string|null - */ - public function getService() : ?string + + public function getService(): ?string { return $this->service; } - /** - * - * - * @param string|null $service - * - * @return self - */ - public function setService(?string $service) : self + + public function setService(?string $service): self { $this->service = $service; + return $this; } - /** - * - * - * @return string|null - */ - public function getServiceIconUrl() : ?string + + public function getServiceIconUrl(): ?string { return $this->serviceIconUrl; } - /** - * - * - * @param string|null $serviceIconUrl - * - * @return self - */ - public function setServiceIconUrl(?string $serviceIconUrl) : self + + public function setServiceIconUrl(?string $serviceIconUrl): self { $this->serviceIconUrl = $serviceIconUrl; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntryInvoice.php b/generated/Model/TimeEntryInvoice.php index 8ce00d9..88fefda 100644 --- a/generated/Model/TimeEntryInvoice.php +++ b/generated/Model/TimeEntryInvoice.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntryInvoice { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $number; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getNumber() : ?string + + public function getNumber(): ?string { return $this->number; } - /** - * - * - * @param string|null $number - * - * @return self - */ - public function setNumber(?string $number) : self + + public function setNumber(?string $number): self { $this->number = $number; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntryProject.php b/generated/Model/TimeEntryProject.php index c7648e8..97a3912 100644 --- a/generated/Model/TimeEntryProject.php +++ b/generated/Model/TimeEntryProject.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntryProject { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntryTask.php b/generated/Model/TimeEntryTask.php index 5da2887..e31adee 100644 --- a/generated/Model/TimeEntryTask.php +++ b/generated/Model/TimeEntryTask.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntryTask { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeEntryUser.php b/generated/Model/TimeEntryUser.php index 5bb4207..114dc1b 100644 --- a/generated/Model/TimeEntryUser.php +++ b/generated/Model/TimeEntryUser.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeEntryUser { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeReportsResult.php b/generated/Model/TimeReportsResult.php index 07e1ff6..92b81fc 100644 --- a/generated/Model/TimeReportsResult.php +++ b/generated/Model/TimeReportsResult.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeReportsResult @@ -82,277 +91,238 @@ class TimeReportsResult * @var float|null */ protected $billableAmount; + /** * The ID of the client associated with the reported hours. Only returned in the Client and Project reports. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client associated with the reported hours. Only returned in the Client and Project reports. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The name of the client associated with the reported hours. Only returned in the Client and Project reports. - * - * @return string|null */ - public function getClientName() : ?string + public function getClientName(): ?string { return $this->clientName; } + /** * The name of the client associated with the reported hours. Only returned in the Client and Project reports. - * - * @param string|null $clientName - * - * @return self */ - public function setClientName(?string $clientName) : self + public function setClientName(?string $clientName): self { $this->clientName = $clientName; + return $this; } + /** * The ID of the project associated with the reported hours. Only returned in the Client and Project reports. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project associated with the reported hours. Only returned in the Client and Project reports. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The name of the project associated with the reported hours. Only returned in the Client and Project reports. - * - * @return string|null */ - public function getProjectName() : ?string + public function getProjectName(): ?string { return $this->projectName; } + /** * The name of the project associated with the reported hours. Only returned in the Client and Project reports. - * - * @param string|null $projectName - * - * @return self */ - public function setProjectName(?string $projectName) : self + public function setProjectName(?string $projectName): self { $this->projectName = $projectName; + return $this; } + /** * The ID of the task associated with the reported hours. Only returned in the Task report. - * - * @return int|null */ - public function getTaskId() : ?int + public function getTaskId(): ?int { return $this->taskId; } + /** * The ID of the task associated with the reported hours. Only returned in the Task report. - * - * @param int|null $taskId - * - * @return self */ - public function setTaskId(?int $taskId) : self + public function setTaskId(?int $taskId): self { $this->taskId = $taskId; + return $this; } + /** * The name of the task associated with the reported hours. Only returned in the Task report. - * - * @return string|null */ - public function getTaskName() : ?string + public function getTaskName(): ?string { return $this->taskName; } + /** * The name of the task associated with the reported hours. Only returned in the Task report. - * - * @param string|null $taskName - * - * @return self */ - public function setTaskName(?string $taskName) : self + public function setTaskName(?string $taskName): self { $this->taskName = $taskName; + return $this; } + /** * The ID of the user associated with the reported hours. Only returned in the Team report. - * - * @return int|null */ - public function getUserId() : ?int + public function getUserId(): ?int { return $this->userId; } + /** * The ID of the user associated with the reported hours. Only returned in the Team report. - * - * @param int|null $userId - * - * @return self */ - public function setUserId(?int $userId) : self + public function setUserId(?int $userId): self { $this->userId = $userId; + return $this; } + /** * The name of the user associated with the reported hours. Only returned in the Team report. - * - * @return string|null */ - public function getUserName() : ?string + public function getUserName(): ?string { return $this->userName; } + /** * The name of the user associated with the reported hours. Only returned in the Team report. - * - * @param string|null $userName - * - * @return self */ - public function setUserName(?string $userName) : self + public function setUserName(?string $userName): self { $this->userName = $userName; + return $this; } + /** * The contractor status of the user associated with the reported hours. Only returned in the Team report. - * - * @return bool|null */ - public function getIsContractor() : ?bool + public function getIsContractor(): ?bool { return $this->isContractor; } + /** * The contractor status of the user associated with the reported hours. Only returned in the Team report. - * - * @param bool|null $isContractor - * - * @return self */ - public function setIsContractor(?bool $isContractor) : self + public function setIsContractor(?bool $isContractor): self { $this->isContractor = $isContractor; + return $this; } + /** * The totaled hours for the given timeframe, subject (client, project, task, or user), and currency. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @return float|null */ - public function getTotalHours() : ?float + public function getTotalHours(): ?float { return $this->totalHours; } + /** * The totaled hours for the given timeframe, subject (client, project, task, or user), and currency. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @param float|null $totalHours - * - * @return self */ - public function setTotalHours(?float $totalHours) : self + public function setTotalHours(?float $totalHours): self { $this->totalHours = $totalHours; + return $this; } + /** * The totaled billable hours for the given timeframe, subject (client, project, task, or user), and currency. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @return float|null */ - public function getBillableHours() : ?float + public function getBillableHours(): ?float { return $this->billableHours; } + /** * The totaled billable hours for the given timeframe, subject (client, project, task, or user), and currency. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @param float|null $billableHours - * - * @return self */ - public function setBillableHours(?float $billableHours) : self + public function setBillableHours(?float $billableHours): self { $this->billableHours = $billableHours; + return $this; } + /** * The currency code associated with the tracked hours for this result. Only visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @return string|null */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** * The currency code associated with the tracked hours for this result. Only visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @param string|null $currency - * - * @return self */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * The totaled billable amount for the billable hours above. Only visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @return float|null */ - public function getBillableAmount() : ?float + public function getBillableAmount(): ?float { return $this->billableAmount; } + /** * The totaled billable amount for the billable hours above. Only visible to Administrators and Project Managers with the View billable rates and amounts permission. - * - * @param float|null $billableAmount - * - * @return self */ - public function setBillableAmount(?float $billableAmount) : self + public function setBillableAmount(?float $billableAmount): self { $this->billableAmount = $billableAmount; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/TimeReportsResults.php b/generated/Model/TimeReportsResults.php index e45e648..8163abc 100644 --- a/generated/Model/TimeReportsResults.php +++ b/generated/Model/TimeReportsResults.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class TimeReportsResults { /** - * - * * @var TimeReportsResult[] */ protected $results; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return TimeReportsResult[] */ - public function getResults() : array + public function getResults(): array { return $this->results; } + /** - * - * * @param TimeReportsResult[] $results - * - * @return self */ - public function setResults(array $results) : self + public function setResults(array $results): self { $this->results = $results; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UninvoicedReportResult.php b/generated/Model/UninvoicedReportResult.php index 100df2d..de9354a 100644 --- a/generated/Model/UninvoicedReportResult.php +++ b/generated/Model/UninvoicedReportResult.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UninvoicedReportResult @@ -58,193 +67,166 @@ class UninvoicedReportResult * @var float|null */ protected $uninvoicedAmount; + /** * The ID of the client associated with the reported hours and expenses. - * - * @return int|null */ - public function getClientId() : ?int + public function getClientId(): ?int { return $this->clientId; } + /** * The ID of the client associated with the reported hours and expenses. - * - * @param int|null $clientId - * - * @return self */ - public function setClientId(?int $clientId) : self + public function setClientId(?int $clientId): self { $this->clientId = $clientId; + return $this; } + /** * The name of the client associated with the reported hours and expenses. - * - * @return string|null */ - public function getClientName() : ?string + public function getClientName(): ?string { return $this->clientName; } + /** * The name of the client associated with the reported hours and expenses. - * - * @param string|null $clientName - * - * @return self */ - public function setClientName(?string $clientName) : self + public function setClientName(?string $clientName): self { $this->clientName = $clientName; + return $this; } + /** * The ID of the project associated with the reported hours and expenses. - * - * @return int|null */ - public function getProjectId() : ?int + public function getProjectId(): ?int { return $this->projectId; } + /** * The ID of the project associated with the reported hours and expenses. - * - * @param int|null $projectId - * - * @return self */ - public function setProjectId(?int $projectId) : self + public function setProjectId(?int $projectId): self { $this->projectId = $projectId; + return $this; } + /** * The name of the project associated with the reported hours and expenses. - * - * @return string|null */ - public function getProjectName() : ?string + public function getProjectName(): ?string { return $this->projectName; } + /** * The name of the project associated with the reported hours and expenses. - * - * @param string|null $projectName - * - * @return self */ - public function setProjectName(?string $projectName) : self + public function setProjectName(?string $projectName): self { $this->projectName = $projectName; + return $this; } + /** * The currency code associated with the tracked hours for this result. - * - * @return string|null */ - public function getCurrency() : ?string + public function getCurrency(): ?string { return $this->currency; } + /** * The currency code associated with the tracked hours for this result. - * - * @param string|null $currency - * - * @return self */ - public function setCurrency(?string $currency) : self + public function setCurrency(?string $currency): self { $this->currency = $currency; + return $this; } + /** * The total hours for the given timeframe and project. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @return float|null */ - public function getTotalHours() : ?float + public function getTotalHours(): ?float { return $this->totalHours; } + /** * The total hours for the given timeframe and project. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @param float|null $totalHours - * - * @return self */ - public function setTotalHours(?float $totalHours) : self + public function setTotalHours(?float $totalHours): self { $this->totalHours = $totalHours; + return $this; } + /** * The total hours for the given timeframe and project that have not been invoiced. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @return float|null */ - public function getUninvoicedHours() : ?float + public function getUninvoicedHours(): ?float { return $this->uninvoicedHours; } + /** * The total hours for the given timeframe and project that have not been invoiced. If Time Rounding is turned on, the hours will be rounded according to your settings. - * - * @param float|null $uninvoicedHours - * - * @return self */ - public function setUninvoicedHours(?float $uninvoicedHours) : self + public function setUninvoicedHours(?float $uninvoicedHours): self { $this->uninvoicedHours = $uninvoicedHours; + return $this; } + /** * The total amount for billable expenses for the timeframe and project that have not been invoiced. - * - * @return float|null */ - public function getUninvoicedExpenses() : ?float + public function getUninvoicedExpenses(): ?float { return $this->uninvoicedExpenses; } + /** * The total amount for billable expenses for the timeframe and project that have not been invoiced. - * - * @param float|null $uninvoicedExpenses - * - * @return self */ - public function setUninvoicedExpenses(?float $uninvoicedExpenses) : self + public function setUninvoicedExpenses(?float $uninvoicedExpenses): self { $this->uninvoicedExpenses = $uninvoicedExpenses; + return $this; } + /** * The total amount (time and expenses) for the timeframe and project that have not been invoiced. - * - * @return float|null */ - public function getUninvoicedAmount() : ?float + public function getUninvoicedAmount(): ?float { return $this->uninvoicedAmount; } + /** * The total amount (time and expenses) for the timeframe and project that have not been invoiced. - * - * @param float|null $uninvoicedAmount - * - * @return self */ - public function setUninvoicedAmount(?float $uninvoicedAmount) : self + public function setUninvoicedAmount(?float $uninvoicedAmount): self { $this->uninvoicedAmount = $uninvoicedAmount; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UninvoicedReportResults.php b/generated/Model/UninvoicedReportResults.php index 028eddc..6fd6961 100644 --- a/generated/Model/UninvoicedReportResults.php +++ b/generated/Model/UninvoicedReportResults.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UninvoicedReportResults { /** - * - * * @var UninvoicedReportResult[] */ protected $results; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return UninvoicedReportResult[] */ - public function getResults() : array + public function getResults(): array { return $this->results; } + /** - * - * * @param UninvoicedReportResult[] $results - * - * @return self */ - public function setResults(array $results) : self + public function setResults(array $results): self { $this->results = $results; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/User.php b/generated/Model/User.php index 73b1e97..53b9221 100644 --- a/generated/Model/User.php +++ b/generated/Model/User.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class User @@ -100,340 +109,296 @@ class User * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the user. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the user. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * The first name of the user. - * - * @return string|null */ - public function getFirstName() : ?string + public function getFirstName(): ?string { return $this->firstName; } + /** * The first name of the user. - * - * @param string|null $firstName - * - * @return self */ - public function setFirstName(?string $firstName) : self + public function setFirstName(?string $firstName): self { $this->firstName = $firstName; + return $this; } + /** * The last name of the user. - * - * @return string|null */ - public function getLastName() : ?string + public function getLastName(): ?string { return $this->lastName; } + /** * The last name of the user. - * - * @param string|null $lastName - * - * @return self */ - public function setLastName(?string $lastName) : self + public function setLastName(?string $lastName): self { $this->lastName = $lastName; + return $this; } + /** * The email address of the user. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * The email address of the user. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } + /** * The user’s telephone number. - * - * @return string|null */ - public function getTelephone() : ?string + public function getTelephone(): ?string { return $this->telephone; } + /** * The user’s telephone number. - * - * @param string|null $telephone - * - * @return self */ - public function setTelephone(?string $telephone) : self + public function setTelephone(?string $telephone): self { $this->telephone = $telephone; + return $this; } + /** * The user’s timezone. - * - * @return string|null */ - public function getTimezone() : ?string + public function getTimezone(): ?string { return $this->timezone; } + /** * The user’s timezone. - * - * @param string|null $timezone - * - * @return self */ - public function setTimezone(?string $timezone) : self + public function setTimezone(?string $timezone): self { $this->timezone = $timezone; + return $this; } + /** * Whether the user should be automatically added to future projects. - * - * @return bool|null */ - public function getHasAccessToAllFutureProjects() : ?bool + public function getHasAccessToAllFutureProjects(): ?bool { return $this->hasAccessToAllFutureProjects; } + /** * Whether the user should be automatically added to future projects. - * - * @param bool|null $hasAccessToAllFutureProjects - * - * @return self */ - public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects) : self + public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self { $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects; + return $this; } + /** * Whether the user is a contractor or an employee. - * - * @return bool|null */ - public function getIsContractor() : ?bool + public function getIsContractor(): ?bool { return $this->isContractor; } + /** * Whether the user is a contractor or an employee. - * - * @param bool|null $isContractor - * - * @return self */ - public function setIsContractor(?bool $isContractor) : self + public function setIsContractor(?bool $isContractor): self { $this->isContractor = $isContractor; + return $this; } + /** * Whether the user is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the user is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + 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. - * - * @return int|null */ - public function getWeeklyCapacity() : ?int + 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. - * - * @param int|null $weeklyCapacity - * - * @return self */ - public function setWeeklyCapacity(?int $weeklyCapacity) : self + public function setWeeklyCapacity(?int $weeklyCapacity): self { $this->weeklyCapacity = $weeklyCapacity; + return $this; } + /** * The billable rate to use for this user when they are added to a project. - * - * @return float|null */ - public function getDefaultHourlyRate() : ?float + public function getDefaultHourlyRate(): ?float { return $this->defaultHourlyRate; } + /** * The billable rate to use for this user when they are added to a project. - * - * @param float|null $defaultHourlyRate - * - * @return self */ - public function setDefaultHourlyRate(?float $defaultHourlyRate) : self + public function setDefaultHourlyRate(?float $defaultHourlyRate): self { $this->defaultHourlyRate = $defaultHourlyRate; + return $this; } + /** * The cost rate to use for this user when calculating a project’s costs vs billable amount. - * - * @return float|null */ - public function getCostRate() : ?float + public function getCostRate(): ?float { return $this->costRate; } + /** * The cost rate to use for this user when calculating a project’s costs vs billable amount. - * - * @param float|null $costRate - * - * @return self */ - public function setCostRate(?float $costRate) : self + public function setCostRate(?float $costRate): self { $this->costRate = $costRate; + return $this; } + /** * The role names assigned to this person. * * @return string[]|null */ - public function getRoles() : ?array + public function getRoles(): ?array { return $this->roles; } + /** * The role names assigned to this person. * * @param string[]|null $roles - * - * @return self */ - public function setRoles(?array $roles) : self + public function setRoles(?array $roles): self { $this->roles = $roles; + return $this; } + /** * The URL to the user’s avatar image. - * - * @return string|null */ - public function getAvatarUrl() : ?string + public function getAvatarUrl(): ?string { return $this->avatarUrl; } + /** * The URL to the user’s avatar image. - * - * @param string|null $avatarUrl - * - * @return self */ - public function setAvatarUrl(?string $avatarUrl) : self + public function setAvatarUrl(?string $avatarUrl): self { $this->avatarUrl = $avatarUrl; + return $this; } + /** * Date and time the user was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the user was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the user was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the user was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UserAssignment.php b/generated/Model/UserAssignment.php index 8e5dd03..7b6d6cb 100644 --- a/generated/Model/UserAssignment.php +++ b/generated/Model/UserAssignment.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UserAssignment @@ -64,214 +73,184 @@ class UserAssignment * @var \DateTime|null */ protected $updatedAt; + /** * Unique ID for the user assignment. - * - * @return int|null */ - public function getId() : ?int + public function getId(): ?int { return $this->id; } + /** * Unique ID for the user assignment. - * - * @param int|null $id - * - * @return self */ - public function setId(?int $id) : self + public function setId(?int $id): self { $this->id = $id; + return $this; } + /** * An object containing the id, name, and code of the associated project. - * - * @return UserAssignmentProject|null */ - public function getProject() : ?UserAssignmentProject + public function getProject(): ?UserAssignmentProject { return $this->project; } + /** * An object containing the id, name, and code of the associated project. - * - * @param UserAssignmentProject|null $project - * - * @return self */ - public function setProject(?UserAssignmentProject $project) : self + public function setProject(?UserAssignmentProject $project): self { $this->project = $project; + return $this; } + /** * An object containing the id and name of the associated user. - * - * @return UserAssignmentUser|null */ - public function getUser() : ?UserAssignmentUser + public function getUser(): ?UserAssignmentUser { return $this->user; } + /** * An object containing the id and name of the associated user. - * - * @param UserAssignmentUser|null $user - * - * @return self */ - public function setUser(?UserAssignmentUser $user) : self + public function setUser(?UserAssignmentUser $user): self { $this->user = $user; + return $this; } + /** * Whether the user assignment is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the user assignment is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * Determines if the user has Project Manager permissions for the project. - * - * @return bool|null */ - public function getIsProjectManager() : ?bool + public function getIsProjectManager(): ?bool { return $this->isProjectManager; } + /** * Determines if the user has Project Manager permissions for the project. - * - * @param bool|null $isProjectManager - * - * @return self */ - public function setIsProjectManager(?bool $isProjectManager) : self + public function setIsProjectManager(?bool $isProjectManager): self { $this->isProjectManager = $isProjectManager; + return $this; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. - * - * @return bool|null */ - public function getUseDefaultRates() : ?bool + public function getUseDefaultRates(): ?bool { return $this->useDefaultRates; } + /** * Determines which billable rate(s) will be used on the project for this user when bill_by is People. When true, the project will use the user’s default billable rates. When false, the project will use the custom rate defined on this user assignment. - * - * @param bool|null $useDefaultRates - * - * @return self */ - public function setUseDefaultRates(?bool $useDefaultRates) : self + public function setUseDefaultRates(?bool $useDefaultRates): self { $this->useDefaultRates = $useDefaultRates; + return $this; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. - * - * @return float|null */ - public function getHourlyRate() : ?float + public function getHourlyRate(): ?float { return $this->hourlyRate; } + /** * Custom rate used when the project’s bill_by is People and use_default_rates is false. - * - * @param float|null $hourlyRate - * - * @return self */ - public function setHourlyRate(?float $hourlyRate) : self + public function setHourlyRate(?float $hourlyRate): self { $this->hourlyRate = $hourlyRate; + return $this; } + /** * Budget used when the project’s budget_by is person. - * - * @return float|null */ - public function getBudget() : ?float + public function getBudget(): ?float { return $this->budget; } + /** * Budget used when the project’s budget_by is person. - * - * @param float|null $budget - * - * @return self */ - public function setBudget(?float $budget) : self + public function setBudget(?float $budget): self { $this->budget = $budget; + return $this; } + /** * Date and time the user assignment was created. - * - * @return \DateTime|null */ - public function getCreatedAt() : ?\DateTime + public function getCreatedAt(): ?\DateTime { return $this->createdAt; } + /** * Date and time the user assignment was created. - * - * @param \DateTime|null $createdAt - * - * @return self */ - public function setCreatedAt(?\DateTime $createdAt) : self + public function setCreatedAt(?\DateTime $createdAt): self { $this->createdAt = $createdAt; + return $this; } + /** * Date and time the user assignment was last updated. - * - * @return \DateTime|null */ - public function getUpdatedAt() : ?\DateTime + public function getUpdatedAt(): ?\DateTime { return $this->updatedAt; } + /** * Date and time the user assignment was last updated. - * - * @param \DateTime|null $updatedAt - * - * @return self */ - public function setUpdatedAt(?\DateTime $updatedAt) : self + public function setUpdatedAt(?\DateTime $updatedAt): self { $this->updatedAt = $updatedAt; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UserAssignmentProject.php b/generated/Model/UserAssignmentProject.php index 69ad3e5..b1bc798 100644 --- a/generated/Model/UserAssignmentProject.php +++ b/generated/Model/UserAssignmentProject.php @@ -1,88 +1,64 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UserAssignmentProject { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; /** - * - * * @var string|null */ protected $code; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } - /** - * - * - * @return string|null - */ - public function getCode() : ?string + + public function getCode(): ?string { return $this->code; } - /** - * - * - * @param string|null $code - * - * @return self - */ - public function setCode(?string $code) : self + + public function setCode(?string $code): self { $this->code = $code; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UserAssignmentUser.php b/generated/Model/UserAssignmentUser.php index b6aa7e8..51e0209 100644 --- a/generated/Model/UserAssignmentUser.php +++ b/generated/Model/UserAssignmentUser.php @@ -1,61 +1,48 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UserAssignmentUser { /** - * - * * @var int|null */ protected $id; /** - * - * * @var string|null */ protected $name; - /** - * - * - * @return int|null - */ - public function getId() : ?int + + public function getId(): ?int { return $this->id; } - /** - * - * - * @param int|null $id - * - * @return self - */ - public function setId(?int $id) : self + + public function setId(?int $id): self { $this->id = $id; + return $this; } - /** - * - * - * @return string|null - */ - public function getName() : ?string + + public function getName(): ?string { return $this->name; } - /** - * - * - * @param string|null $name - * - * @return self - */ - public function setName(?string $name) : self + + public function setName(?string $name): self { $this->name = $name; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UserAssignments.php b/generated/Model/UserAssignments.php index 8658ad1..03c2e69 100644 --- a/generated/Model/UserAssignments.php +++ b/generated/Model/UserAssignments.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UserAssignments { /** - * - * * @var UserAssignment[] */ protected $userAssignments; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return UserAssignment[] */ - public function getUserAssignments() : array + public function getUserAssignments(): array { return $this->userAssignments; } + /** - * - * * @param UserAssignment[] $userAssignments - * - * @return self */ - public function setUserAssignments(array $userAssignments) : self + public function setUserAssignments(array $userAssignments): self { $this->userAssignments = $userAssignments; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/Users.php b/generated/Model/Users.php index 6066db0..d6de933 100644 --- a/generated/Model/Users.php +++ b/generated/Model/Users.php @@ -1,223 +1,150 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class Users { /** - * - * * @var User[] */ protected $users; /** - * - * * @var int */ protected $perPage; /** - * - * * @var int */ protected $totalPages; /** - * - * * @var int */ protected $totalEntries; /** - * - * * @var int|null */ protected $nextPage; /** - * - * * @var int|null */ protected $previousPage; /** - * - * * @var int */ protected $page; /** - * - * * @var PaginationLinks */ protected $links; + /** - * - * * @return User[] */ - public function getUsers() : array + public function getUsers(): array { return $this->users; } + /** - * - * * @param User[] $users - * - * @return self */ - public function setUsers(array $users) : self + public function setUsers(array $users): self { $this->users = $users; + return $this; } - /** - * - * - * @return int - */ - public function getPerPage() : int + + public function getPerPage(): int { return $this->perPage; } - /** - * - * - * @param int $perPage - * - * @return self - */ - public function setPerPage(int $perPage) : self + + public function setPerPage(int $perPage): self { $this->perPage = $perPage; + return $this; } - /** - * - * - * @return int - */ - public function getTotalPages() : int + + public function getTotalPages(): int { return $this->totalPages; } - /** - * - * - * @param int $totalPages - * - * @return self - */ - public function setTotalPages(int $totalPages) : self + + public function setTotalPages(int $totalPages): self { $this->totalPages = $totalPages; + return $this; } - /** - * - * - * @return int - */ - public function getTotalEntries() : int + + public function getTotalEntries(): int { return $this->totalEntries; } - /** - * - * - * @param int $totalEntries - * - * @return self - */ - public function setTotalEntries(int $totalEntries) : self + + public function setTotalEntries(int $totalEntries): self { $this->totalEntries = $totalEntries; + return $this; } - /** - * - * - * @return int|null - */ - public function getNextPage() : ?int + + public function getNextPage(): ?int { return $this->nextPage; } - /** - * - * - * @param int|null $nextPage - * - * @return self - */ - public function setNextPage(?int $nextPage) : self + + public function setNextPage(?int $nextPage): self { $this->nextPage = $nextPage; + return $this; } - /** - * - * - * @return int|null - */ - public function getPreviousPage() : ?int + + public function getPreviousPage(): ?int { return $this->previousPage; } - /** - * - * - * @param int|null $previousPage - * - * @return self - */ - public function setPreviousPage(?int $previousPage) : self + + public function setPreviousPage(?int $previousPage): self { $this->previousPage = $previousPage; + return $this; } - /** - * - * - * @return int - */ - public function getPage() : int + + public function getPage(): int { return $this->page; } - /** - * - * - * @param int $page - * - * @return self - */ - public function setPage(int $page) : self + + public function setPage(int $page): self { $this->page = $page; + return $this; } - /** - * - * - * @return PaginationLinks - */ - public function getLinks() : PaginationLinks + + public function getLinks(): PaginationLinks { return $this->links; } - /** - * - * - * @param PaginationLinks $links - * - * @return self - */ - public function setLinks(PaginationLinks $links) : self + + public function setLinks(PaginationLinks $links): self { $this->links = $links; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UsersPostBody.php b/generated/Model/UsersPostBody.php index 2b213ed..f0d8997 100644 --- a/generated/Model/UsersPostBody.php +++ b/generated/Model/UsersPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UsersPostBody @@ -70,235 +79,206 @@ class UsersPostBody * @var string[]|null */ protected $roles; + /** * The first name of the user. - * - * @return string|null */ - public function getFirstName() : ?string + public function getFirstName(): ?string { return $this->firstName; } + /** * The first name of the user. - * - * @param string|null $firstName - * - * @return self */ - public function setFirstName(?string $firstName) : self + public function setFirstName(?string $firstName): self { $this->firstName = $firstName; + return $this; } + /** * The last name of the user. - * - * @return string|null */ - public function getLastName() : ?string + public function getLastName(): ?string { return $this->lastName; } + /** * The last name of the user. - * - * @param string|null $lastName - * - * @return self */ - public function setLastName(?string $lastName) : self + public function setLastName(?string $lastName): self { $this->lastName = $lastName; + return $this; } + /** * The email address of the user. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * The email address of the user. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } + /** * The user’s timezone. Defaults to the company’s timezone. See a list of supported time zones. - * - * @return string|null */ - public function getTimezone() : ?string + public function getTimezone(): ?string { return $this->timezone; } + /** * The user’s timezone. Defaults to the company’s timezone. See a list of supported time zones. - * - * @param string|null $timezone - * - * @return self */ - public function setTimezone(?string $timezone) : self + public function setTimezone(?string $timezone): self { $this->timezone = $timezone; + return $this; } + /** * Whether the user should be automatically added to future projects. Defaults to false. - * - * @return bool|null */ - public function getHasAccessToAllFutureProjects() : ?bool + public function getHasAccessToAllFutureProjects(): ?bool { return $this->hasAccessToAllFutureProjects; } + /** * Whether the user should be automatically added to future projects. Defaults to false. - * - * @param bool|null $hasAccessToAllFutureProjects - * - * @return self */ - public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects) : self + public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self { $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects; + return $this; } + /** * Whether the user is a contractor or an employee. Defaults to false. - * - * @return bool|null */ - public function getIsContractor() : ?bool + public function getIsContractor(): ?bool { return $this->isContractor; } + /** * Whether the user is a contractor or an employee. Defaults to false. - * - * @param bool|null $isContractor - * - * @return self */ - public function setIsContractor(?bool $isContractor) : self + public function setIsContractor(?bool $isContractor): self { $this->isContractor = $isContractor; + return $this; } + /** * Whether the user is active or archived. Defaults to true. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the user is active or archived. Defaults to true. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * The number of hours per week this person is available to work in seconds. Defaults to 126000 seconds (35 hours). - * - * @return int|null */ - public function getWeeklyCapacity() : ?int + public function getWeeklyCapacity(): ?int { return $this->weeklyCapacity; } + /** * The number of hours per week this person is available to work in seconds. Defaults to 126000 seconds (35 hours). - * - * @param int|null $weeklyCapacity - * - * @return self */ - public function setWeeklyCapacity(?int $weeklyCapacity) : self + public function setWeeklyCapacity(?int $weeklyCapacity): self { $this->weeklyCapacity = $weeklyCapacity; + return $this; } + /** * The billable rate to use for this user when they are added to a project. Defaults to 0. - * - * @return float|null */ - public function getDefaultHourlyRate() : ?float + public function getDefaultHourlyRate(): ?float { return $this->defaultHourlyRate; } + /** * The billable rate to use for this user when they are added to a project. Defaults to 0. - * - * @param float|null $defaultHourlyRate - * - * @return self */ - public function setDefaultHourlyRate(?float $defaultHourlyRate) : self + public function setDefaultHourlyRate(?float $defaultHourlyRate): self { $this->defaultHourlyRate = $defaultHourlyRate; + return $this; } + /** * The cost rate to use for this user when calculating a project’s costs vs billable amount. Defaults to 0. - * - * @return float|null */ - public function getCostRate() : ?float + public function getCostRate(): ?float { return $this->costRate; } + /** * The cost rate to use for this user when calculating a project’s costs vs billable amount. Defaults to 0. - * - * @param float|null $costRate - * - * @return self */ - public function setCostRate(?float $costRate) : self + public function setCostRate(?float $costRate): self { $this->costRate = $costRate; + return $this; } + /** * The role names assigned to this person. * * @return string[]|null */ - public function getRoles() : ?array + public function getRoles(): ?array { return $this->roles; } + /** * The role names assigned to this person. * * @param string[]|null $roles - * - * @return self */ - public function setRoles(?array $roles) : self + public function setRoles(?array $roles): self { $this->roles = $roles; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UsersUserIdBillableRatesPostBody.php b/generated/Model/UsersUserIdBillableRatesPostBody.php index 86770dc..d398d14 100644 --- a/generated/Model/UsersUserIdBillableRatesPostBody.php +++ b/generated/Model/UsersUserIdBillableRatesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UsersUserIdBillableRatesPostBody @@ -16,46 +25,40 @@ class UsersUserIdBillableRatesPostBody * @var \DateTime|null */ protected $startDate; + /** * The amount of the billable rate. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The amount of the billable rate. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * The date the billable rate is effective. Cannot be a date in the future. - * - * @return \DateTime|null */ - public function getStartDate() : ?\DateTime + public function getStartDate(): ?\DateTime { return $this->startDate; } + /** * The date the billable rate is effective. Cannot be a date in the future. - * - * @param \DateTime|null $startDate - * - * @return self */ - public function setStartDate(?\DateTime $startDate) : self + public function setStartDate(?\DateTime $startDate): self { $this->startDate = $startDate; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UsersUserIdCostRatesPostBody.php b/generated/Model/UsersUserIdCostRatesPostBody.php index 4a588ef..14afce8 100644 --- a/generated/Model/UsersUserIdCostRatesPostBody.php +++ b/generated/Model/UsersUserIdCostRatesPostBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UsersUserIdCostRatesPostBody @@ -16,46 +25,40 @@ class UsersUserIdCostRatesPostBody * @var \DateTime|null */ protected $startDate; + /** * The amount of the cost rate. - * - * @return float|null */ - public function getAmount() : ?float + public function getAmount(): ?float { return $this->amount; } + /** * The amount of the cost rate. - * - * @param float|null $amount - * - * @return self */ - public function setAmount(?float $amount) : self + public function setAmount(?float $amount): self { $this->amount = $amount; + return $this; } + /** * The date the cost rate is effective. Cannot be a date in the future. - * - * @return \DateTime|null */ - public function getStartDate() : ?\DateTime + public function getStartDate(): ?\DateTime { return $this->startDate; } + /** * The date the cost rate is effective. Cannot be a date in the future. - * - * @param \DateTime|null $startDate - * - * @return self */ - public function setStartDate(?\DateTime $startDate) : self + public function setStartDate(?\DateTime $startDate): self { $this->startDate = $startDate; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Model/UsersUserIdPatchBody.php b/generated/Model/UsersUserIdPatchBody.php index 1ecd6ea..31957aa 100644 --- a/generated/Model/UsersUserIdPatchBody.php +++ b/generated/Model/UsersUserIdPatchBody.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Model; class UsersUserIdPatchBody @@ -70,235 +79,206 @@ class UsersUserIdPatchBody * @var string[]|null */ protected $roles; + /** * The first name of the user. Can’t be updated if the user is inactive. - * - * @return string|null */ - public function getFirstName() : ?string + public function getFirstName(): ?string { return $this->firstName; } + /** * The first name of the user. Can’t be updated if the user is inactive. - * - * @param string|null $firstName - * - * @return self */ - public function setFirstName(?string $firstName) : self + public function setFirstName(?string $firstName): self { $this->firstName = $firstName; + return $this; } + /** * The last name of the user. Can’t be updated if the user is inactive. - * - * @return string|null */ - public function getLastName() : ?string + public function getLastName(): ?string { return $this->lastName; } + /** * The last name of the user. Can’t be updated if the user is inactive. - * - * @param string|null $lastName - * - * @return self */ - public function setLastName(?string $lastName) : self + public function setLastName(?string $lastName): self { $this->lastName = $lastName; + return $this; } + /** * The email address of the user. Can’t be updated if the user is inactive. - * - * @return string|null */ - public function getEmail() : ?string + public function getEmail(): ?string { return $this->email; } + /** * The email address of the user. Can’t be updated if the user is inactive. - * - * @param string|null $email - * - * @return self */ - public function setEmail(?string $email) : self + public function setEmail(?string $email): self { $this->email = $email; + return $this; } + /** * The user’s timezone. Defaults to the company’s timezone. See a list of supported time zones. - * - * @return string|null */ - public function getTimezone() : ?string + public function getTimezone(): ?string { return $this->timezone; } + /** * The user’s timezone. Defaults to the company’s timezone. See a list of supported time zones. - * - * @param string|null $timezone - * - * @return self */ - public function setTimezone(?string $timezone) : self + public function setTimezone(?string $timezone): self { $this->timezone = $timezone; + return $this; } + /** * Whether the user should be automatically added to future projects. - * - * @return bool|null */ - public function getHasAccessToAllFutureProjects() : ?bool + public function getHasAccessToAllFutureProjects(): ?bool { return $this->hasAccessToAllFutureProjects; } + /** * Whether the user should be automatically added to future projects. - * - * @param bool|null $hasAccessToAllFutureProjects - * - * @return self */ - public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects) : self + public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self { $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects; + return $this; } + /** * Whether the user is a contractor or an employee. - * - * @return bool|null */ - public function getIsContractor() : ?bool + public function getIsContractor(): ?bool { return $this->isContractor; } + /** * Whether the user is a contractor or an employee. - * - * @param bool|null $isContractor - * - * @return self */ - public function setIsContractor(?bool $isContractor) : self + public function setIsContractor(?bool $isContractor): self { $this->isContractor = $isContractor; + return $this; } + /** * Whether the user is active or archived. - * - * @return bool|null */ - public function getIsActive() : ?bool + public function getIsActive(): ?bool { return $this->isActive; } + /** * Whether the user is active or archived. - * - * @param bool|null $isActive - * - * @return self */ - public function setIsActive(?bool $isActive) : self + public function setIsActive(?bool $isActive): self { $this->isActive = $isActive; + return $this; } + /** * The number of hours per week this person is available to work in seconds. - * - * @return int|null */ - public function getWeeklyCapacity() : ?int + public function getWeeklyCapacity(): ?int { return $this->weeklyCapacity; } + /** * The number of hours per week this person is available to work in seconds. - * - * @param int|null $weeklyCapacity - * - * @return self */ - public function setWeeklyCapacity(?int $weeklyCapacity) : self + public function setWeeklyCapacity(?int $weeklyCapacity): self { $this->weeklyCapacity = $weeklyCapacity; + return $this; } + /** * The billable rate to use for this user when they are added to a project. - * - * @return float|null */ - public function getDefaultHourlyRate() : ?float + public function getDefaultHourlyRate(): ?float { return $this->defaultHourlyRate; } + /** * The billable rate to use for this user when they are added to a project. - * - * @param float|null $defaultHourlyRate - * - * @return self */ - public function setDefaultHourlyRate(?float $defaultHourlyRate) : self + public function setDefaultHourlyRate(?float $defaultHourlyRate): self { $this->defaultHourlyRate = $defaultHourlyRate; + return $this; } + /** * The cost rate to use for this user when calculating a project’s costs vs billable amount. - * - * @return float|null */ - public function getCostRate() : ?float + public function getCostRate(): ?float { return $this->costRate; } + /** * The cost rate to use for this user when calculating a project’s costs vs billable amount. - * - * @param float|null $costRate - * - * @return self */ - public function setCostRate(?float $costRate) : self + public function setCostRate(?float $costRate): self { $this->costRate = $costRate; + return $this; } + /** * The role names assigned to this person. * * @return string[]|null */ - public function getRoles() : ?array + public function getRoles(): ?array { return $this->roles; } + /** * The role names assigned to this person. * * @param string[]|null $roles - * - * @return self */ - public function setRoles(?array $roles) : self + public function setRoles(?array $roles): self { $this->roles = $roles; + return $this; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/BillableRateNormalizer.php b/generated/Normalizer/BillableRateNormalizer.php index aea248e..6b985cb 100644 --- a/generated/Normalizer/BillableRateNormalizer.php +++ b/generated/Normalizer/BillableRateNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class BillableRateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\BillableRate'; + return 'JoliCode\\Harvest\\Api\\Model\\BillableRate' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\BillableRate'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\BillableRate' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,50 +55,49 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('start_date', $data) && $data['start_date'] !== 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)); - } - elseif (\array_key_exists('start_date', $data) && $data['start_date'] === null) { + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } - if (\array_key_exists('end_date', $data) && $data['end_date'] !== 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)); - } - elseif (\array_key_exists('end_date', $data) && $data['end_date'] === null) { + } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { $object->setEndDate(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -104,6 +116,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/BillableRatesNormalizer.php b/generated/Normalizer/BillableRatesNormalizer.php index 6020489..10ca98f 100644 --- a/generated/Normalizer/BillableRatesNormalizer.php +++ b/generated/Normalizer/BillableRatesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class BillableRatesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\BillableRates'; + return 'JoliCode\\Harvest\\Api\\Model\\BillableRates' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\BillableRates'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\BillableRates' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('billable_rates', $data)) { - $values = array(); + $values = []; foreach ($data['billable_rates'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\BillableRate', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getBillableRates() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ClientNormalizer.php b/generated/Normalizer/ClientNormalizer.php index c167436..cf51d8d 100644 --- a/generated/Normalizer/ClientNormalizer.php +++ b/generated/Normalizer/ClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Client'; + return 'JoliCode\\Harvest\\Api\\Model\\Client' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Client'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Client' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,62 +55,59 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('address', $data) && $data['address'] !== null) { + if (\array_key_exists('address', $data) && null !== $data['address']) { $object->setAddress($data['address']); - } - elseif (\array_key_exists('address', $data) && $data['address'] === null) { + } elseif (\array_key_exists('address', $data) && null === $data['address']) { $object->setAddress(null); } - if (\array_key_exists('statement_key', $data) && $data['statement_key'] !== null) { + if (\array_key_exists('statement_key', $data) && null !== $data['statement_key']) { $object->setStatementKey($data['statement_key']); - } - elseif (\array_key_exists('statement_key', $data) && $data['statement_key'] === null) { + } elseif (\array_key_exists('statement_key', $data) && null === $data['statement_key']) { $object->setStatementKey(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -122,6 +132,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php b/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php index 703ef9c..a728d97 100644 --- a/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ClientsClientIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ClientsClientIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ClientsClientIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('address', $data) && $data['address'] !== null) { + if (\array_key_exists('address', $data) && null !== $data['address']) { $object->setAddress($data['address']); - } - elseif (\array_key_exists('address', $data) && $data['address'] === null) { + } elseif (\array_key_exists('address', $data) && null === $data['address']) { $object->setAddress(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ClientsNormalizer.php b/generated/Normalizer/ClientsNormalizer.php index d5d7f21..e7b0e38 100644 --- a/generated/Normalizer/ClientsNormalizer.php +++ b/generated/Normalizer/ClientsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ClientsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Clients'; + return 'JoliCode\\Harvest\\Api\\Model\\Clients' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Clients'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Clients' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('clients', $data)) { - $values = array(); + $values = []; foreach ($data['clients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Client', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getClients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ClientsPostBodyNormalizer.php b/generated/Normalizer/ClientsPostBodyNormalizer.php index 4228163..4a13ec8 100644 --- a/generated/Normalizer/ClientsPostBodyNormalizer.php +++ b/generated/Normalizer/ClientsPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ClientsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ClientsPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('address', $data) && $data['address'] !== null) { + if (\array_key_exists('address', $data) && null !== $data['address']) { $object->setAddress($data['address']); - } - elseif (\array_key_exists('address', $data) && $data['address'] === null) { + } elseif (\array_key_exists('address', $data) && null === $data['address']) { $object->setAddress(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['name'] = $object->getName(); if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); @@ -84,6 +98,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/CompaniesNormalizer.php b/generated/Normalizer/CompaniesNormalizer.php index e240498..63133b7 100644 --- a/generated/Normalizer/CompaniesNormalizer.php +++ b/generated/Normalizer/CompaniesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class CompaniesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Companies'; + return 'JoliCode\\Harvest\\Api\\Model\\Companies' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Companies'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Companies' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('companies', $data)) { - $values = array(); + $values = []; foreach ($data['companies'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Company', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getCompanies() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/CompanyNormalizer.php b/generated/Normalizer/CompanyNormalizer.php index dc65aec..827888e 100644 --- a/generated/Normalizer/CompanyNormalizer.php +++ b/generated/Normalizer/CompanyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class CompanyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Company'; + return 'JoliCode\\Harvest\\Api\\Model\\Company' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Company'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Company' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,134 +55,119 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('base_uri', $data) && $data['base_uri'] !== null) { + if (\array_key_exists('base_uri', $data) && null !== $data['base_uri']) { $object->setBaseUri($data['base_uri']); - } - elseif (\array_key_exists('base_uri', $data) && $data['base_uri'] === null) { + } elseif (\array_key_exists('base_uri', $data) && null === $data['base_uri']) { $object->setBaseUri(null); } - if (\array_key_exists('full_domain', $data) && $data['full_domain'] !== null) { + if (\array_key_exists('full_domain', $data) && null !== $data['full_domain']) { $object->setFullDomain($data['full_domain']); - } - elseif (\array_key_exists('full_domain', $data) && $data['full_domain'] === null) { + } elseif (\array_key_exists('full_domain', $data) && null === $data['full_domain']) { $object->setFullDomain(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('week_start_day', $data) && $data['week_start_day'] !== null) { + if (\array_key_exists('week_start_day', $data) && null !== $data['week_start_day']) { $object->setWeekStartDay($data['week_start_day']); - } - elseif (\array_key_exists('week_start_day', $data) && $data['week_start_day'] === null) { + } elseif (\array_key_exists('week_start_day', $data) && null === $data['week_start_day']) { $object->setWeekStartDay(null); } - if (\array_key_exists('wants_timestamp_timers', $data) && $data['wants_timestamp_timers'] !== null) { + if (\array_key_exists('wants_timestamp_timers', $data) && null !== $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers($data['wants_timestamp_timers']); - } - elseif (\array_key_exists('wants_timestamp_timers', $data) && $data['wants_timestamp_timers'] === null) { + } elseif (\array_key_exists('wants_timestamp_timers', $data) && null === $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers(null); } - if (\array_key_exists('time_format', $data) && $data['time_format'] !== null) { + if (\array_key_exists('time_format', $data) && null !== $data['time_format']) { $object->setTimeFormat($data['time_format']); - } - elseif (\array_key_exists('time_format', $data) && $data['time_format'] === null) { + } elseif (\array_key_exists('time_format', $data) && null === $data['time_format']) { $object->setTimeFormat(null); } - if (\array_key_exists('date_format', $data) && $data['date_format'] !== null) { + if (\array_key_exists('date_format', $data) && null !== $data['date_format']) { $object->setDateFormat($data['date_format']); - } - elseif (\array_key_exists('date_format', $data) && $data['date_format'] === null) { + } elseif (\array_key_exists('date_format', $data) && null === $data['date_format']) { $object->setDateFormat(null); } - if (\array_key_exists('plan_type', $data) && $data['plan_type'] !== null) { + if (\array_key_exists('plan_type', $data) && null !== $data['plan_type']) { $object->setPlanType($data['plan_type']); - } - elseif (\array_key_exists('plan_type', $data) && $data['plan_type'] === null) { + } elseif (\array_key_exists('plan_type', $data) && null === $data['plan_type']) { $object->setPlanType(null); } - if (\array_key_exists('clock', $data) && $data['clock'] !== null) { + if (\array_key_exists('clock', $data) && null !== $data['clock']) { $object->setClock($data['clock']); - } - elseif (\array_key_exists('clock', $data) && $data['clock'] === null) { + } elseif (\array_key_exists('clock', $data) && null === $data['clock']) { $object->setClock(null); } - if (\array_key_exists('currency_code_display', $data) && $data['currency_code_display'] !== null) { + if (\array_key_exists('currency_code_display', $data) && null !== $data['currency_code_display']) { $object->setCurrencyCodeDisplay($data['currency_code_display']); - } - elseif (\array_key_exists('currency_code_display', $data) && $data['currency_code_display'] === null) { + } elseif (\array_key_exists('currency_code_display', $data) && null === $data['currency_code_display']) { $object->setCurrencyCodeDisplay(null); } - if (\array_key_exists('currency_symbol_display', $data) && $data['currency_symbol_display'] !== null) { + if (\array_key_exists('currency_symbol_display', $data) && null !== $data['currency_symbol_display']) { $object->setCurrencySymbolDisplay($data['currency_symbol_display']); - } - elseif (\array_key_exists('currency_symbol_display', $data) && $data['currency_symbol_display'] === null) { + } elseif (\array_key_exists('currency_symbol_display', $data) && null === $data['currency_symbol_display']) { $object->setCurrencySymbolDisplay(null); } - if (\array_key_exists('decimal_symbol', $data) && $data['decimal_symbol'] !== null) { + if (\array_key_exists('decimal_symbol', $data) && null !== $data['decimal_symbol']) { $object->setDecimalSymbol($data['decimal_symbol']); - } - elseif (\array_key_exists('decimal_symbol', $data) && $data['decimal_symbol'] === null) { + } elseif (\array_key_exists('decimal_symbol', $data) && null === $data['decimal_symbol']) { $object->setDecimalSymbol(null); } - if (\array_key_exists('thousands_separator', $data) && $data['thousands_separator'] !== null) { + if (\array_key_exists('thousands_separator', $data) && null !== $data['thousands_separator']) { $object->setThousandsSeparator($data['thousands_separator']); - } - elseif (\array_key_exists('thousands_separator', $data) && $data['thousands_separator'] === null) { + } elseif (\array_key_exists('thousands_separator', $data) && null === $data['thousands_separator']) { $object->setThousandsSeparator(null); } - if (\array_key_exists('color_scheme', $data) && $data['color_scheme'] !== null) { + if (\array_key_exists('color_scheme', $data) && null !== $data['color_scheme']) { $object->setColorScheme($data['color_scheme']); - } - elseif (\array_key_exists('color_scheme', $data) && $data['color_scheme'] === null) { + } elseif (\array_key_exists('color_scheme', $data) && null === $data['color_scheme']) { $object->setColorScheme(null); } - if (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] !== null) { + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); - } - elseif (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] === null) { + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } - if (\array_key_exists('expense_feature', $data) && $data['expense_feature'] !== null) { + if (\array_key_exists('expense_feature', $data) && null !== $data['expense_feature']) { $object->setExpenseFeature($data['expense_feature']); - } - elseif (\array_key_exists('expense_feature', $data) && $data['expense_feature'] === null) { + } elseif (\array_key_exists('expense_feature', $data) && null === $data['expense_feature']) { $object->setExpenseFeature(null); } - if (\array_key_exists('invoice_feature', $data) && $data['invoice_feature'] !== null) { + if (\array_key_exists('invoice_feature', $data) && null !== $data['invoice_feature']) { $object->setInvoiceFeature($data['invoice_feature']); - } - elseif (\array_key_exists('invoice_feature', $data) && $data['invoice_feature'] === null) { + } elseif (\array_key_exists('invoice_feature', $data) && null === $data['invoice_feature']) { $object->setInvoiceFeature(null); } - if (\array_key_exists('estimate_feature', $data) && $data['estimate_feature'] !== null) { + if (\array_key_exists('estimate_feature', $data) && null !== $data['estimate_feature']) { $object->setEstimateFeature($data['estimate_feature']); - } - elseif (\array_key_exists('estimate_feature', $data) && $data['estimate_feature'] === null) { + } elseif (\array_key_exists('estimate_feature', $data) && null === $data['estimate_feature']) { $object->setEstimateFeature(null); } - if (\array_key_exists('approval_feature', $data) && $data['approval_feature'] !== null) { + if (\array_key_exists('approval_feature', $data) && null !== $data['approval_feature']) { $object->setApprovalFeature($data['approval_feature']); - } - elseif (\array_key_exists('approval_feature', $data) && $data['approval_feature'] === null) { + } elseif (\array_key_exists('approval_feature', $data) && null === $data['approval_feature']) { $object->setApprovalFeature(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getBaseUri()) { $data['base_uri'] = $object->getBaseUri(); } @@ -230,6 +228,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getApprovalFeature()) { $data['approval_feature'] = $object->getApprovalFeature(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/CompanyPatchBodyNormalizer.php b/generated/Normalizer/CompanyPatchBodyNormalizer.php index 1015820..b21995a 100644 --- a/generated/Normalizer/CompanyPatchBodyNormalizer.php +++ b/generated/Normalizer/CompanyPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class CompanyPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\CompanyPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('wants_timestamp_timers', $data) && $data['wants_timestamp_timers'] !== null) { + if (\array_key_exists('wants_timestamp_timers', $data) && null !== $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers($data['wants_timestamp_timers']); - } - elseif (\array_key_exists('wants_timestamp_timers', $data) && $data['wants_timestamp_timers'] === null) { + } elseif (\array_key_exists('wants_timestamp_timers', $data) && null === $data['wants_timestamp_timers']) { $object->setWantsTimestampTimers(null); } - if (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] !== null) { + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); - } - elseif (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] === null) { + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getWantsTimestampTimers()) { $data['wants_timestamp_timers'] = $object->getWantsTimestampTimers(); } if (null !== $object->getWeeklyCapacity()) { $data['weekly_capacity'] = $object->getWeeklyCapacity(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ContactClientNormalizer.php b/generated/Normalizer/ContactClientNormalizer.php index 29323a1..84465d4 100644 --- a/generated/Normalizer/ContactClientNormalizer.php +++ b/generated/Normalizer/ContactClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ContactClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ContactClient'; + return 'JoliCode\\Harvest\\Api\\Model\\ContactClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ContactClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ContactClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ContactNormalizer.php b/generated/Normalizer/ContactNormalizer.php index 9f4b64d..1a73f0d 100644 --- a/generated/Normalizer/ContactNormalizer.php +++ b/generated/Normalizer/ContactNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ContactNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Contact'; + return 'JoliCode\\Harvest\\Api\\Model\\Contact' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Contact'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Contact' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,80 +55,74 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ContactClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('title', $data) && $data['title'] !== null) { + if (\array_key_exists('title', $data) && null !== $data['title']) { $object->setTitle($data['title']); - } - elseif (\array_key_exists('title', $data) && $data['title'] === null) { + } elseif (\array_key_exists('title', $data) && null === $data['title']) { $object->setTitle(null); } - if (\array_key_exists('first_name', $data) && $data['first_name'] !== null) { + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); - } - elseif (\array_key_exists('first_name', $data) && $data['first_name'] === null) { + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } - if (\array_key_exists('last_name', $data) && $data['last_name'] !== null) { + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); - } - elseif (\array_key_exists('last_name', $data) && $data['last_name'] === null) { + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } - if (\array_key_exists('phone_office', $data) && $data['phone_office'] !== null) { + if (\array_key_exists('phone_office', $data) && null !== $data['phone_office']) { $object->setPhoneOffice($data['phone_office']); - } - elseif (\array_key_exists('phone_office', $data) && $data['phone_office'] === null) { + } elseif (\array_key_exists('phone_office', $data) && null === $data['phone_office']) { $object->setPhoneOffice(null); } - if (\array_key_exists('phone_mobile', $data) && $data['phone_mobile'] !== null) { + if (\array_key_exists('phone_mobile', $data) && null !== $data['phone_mobile']) { $object->setPhoneMobile($data['phone_mobile']); - } - elseif (\array_key_exists('phone_mobile', $data) && $data['phone_mobile'] === null) { + } elseif (\array_key_exists('phone_mobile', $data) && null === $data['phone_mobile']) { $object->setPhoneMobile(null); } - if (\array_key_exists('fax', $data) && $data['fax'] !== null) { + if (\array_key_exists('fax', $data) && null !== $data['fax']) { $object->setFax($data['fax']); - } - elseif (\array_key_exists('fax', $data) && $data['fax'] === null) { + } elseif (\array_key_exists('fax', $data) && null === $data['fax']) { $object->setFax(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -149,6 +156,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php b/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php index 9174e71..e2315a5 100644 --- a/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ContactsContactIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ContactsContactIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ContactsContactIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,62 +55,59 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('title', $data) && $data['title'] !== null) { + if (\array_key_exists('title', $data) && null !== $data['title']) { $object->setTitle($data['title']); - } - elseif (\array_key_exists('title', $data) && $data['title'] === null) { + } elseif (\array_key_exists('title', $data) && null === $data['title']) { $object->setTitle(null); } - if (\array_key_exists('first_name', $data) && $data['first_name'] !== null) { + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); - } - elseif (\array_key_exists('first_name', $data) && $data['first_name'] === null) { + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } - if (\array_key_exists('last_name', $data) && $data['last_name'] !== null) { + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); - } - elseif (\array_key_exists('last_name', $data) && $data['last_name'] === null) { + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } - if (\array_key_exists('phone_office', $data) && $data['phone_office'] !== null) { + if (\array_key_exists('phone_office', $data) && null !== $data['phone_office']) { $object->setPhoneOffice($data['phone_office']); - } - elseif (\array_key_exists('phone_office', $data) && $data['phone_office'] === null) { + } elseif (\array_key_exists('phone_office', $data) && null === $data['phone_office']) { $object->setPhoneOffice(null); } - if (\array_key_exists('phone_mobile', $data) && $data['phone_mobile'] !== null) { + if (\array_key_exists('phone_mobile', $data) && null !== $data['phone_mobile']) { $object->setPhoneMobile($data['phone_mobile']); - } - elseif (\array_key_exists('phone_mobile', $data) && $data['phone_mobile'] === null) { + } elseif (\array_key_exists('phone_mobile', $data) && null === $data['phone_mobile']) { $object->setPhoneMobile(null); } - if (\array_key_exists('fax', $data) && $data['fax'] !== null) { + if (\array_key_exists('fax', $data) && null !== $data['fax']) { $object->setFax($data['fax']); - } - elseif (\array_key_exists('fax', $data) && $data['fax'] === null) { + } elseif (\array_key_exists('fax', $data) && null === $data['fax']) { $object->setFax(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -122,6 +132,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getFax()) { $data['fax'] = $object->getFax(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ContactsNormalizer.php b/generated/Normalizer/ContactsNormalizer.php index e0adf15..c6fdf85 100644 --- a/generated/Normalizer/ContactsNormalizer.php +++ b/generated/Normalizer/ContactsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ContactsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Contacts'; + return 'JoliCode\\Harvest\\Api\\Model\\Contacts' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Contacts'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Contacts' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('contacts', $data)) { - $values = array(); + $values = []; foreach ($data['contacts'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Contact', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getContacts() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ContactsPostBodyNormalizer.php b/generated/Normalizer/ContactsPostBodyNormalizer.php index c5082b6..4657849 100644 --- a/generated/Normalizer/ContactsPostBodyNormalizer.php +++ b/generated/Normalizer/ContactsPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ContactsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ContactsPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,62 +55,59 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('title', $data) && $data['title'] !== null) { + if (\array_key_exists('title', $data) && null !== $data['title']) { $object->setTitle($data['title']); - } - elseif (\array_key_exists('title', $data) && $data['title'] === null) { + } elseif (\array_key_exists('title', $data) && null === $data['title']) { $object->setTitle(null); } - if (\array_key_exists('first_name', $data) && $data['first_name'] !== null) { + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); - } - elseif (\array_key_exists('first_name', $data) && $data['first_name'] === null) { + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } - if (\array_key_exists('last_name', $data) && $data['last_name'] !== null) { + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); - } - elseif (\array_key_exists('last_name', $data) && $data['last_name'] === null) { + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } - if (\array_key_exists('phone_office', $data) && $data['phone_office'] !== null) { + if (\array_key_exists('phone_office', $data) && null !== $data['phone_office']) { $object->setPhoneOffice($data['phone_office']); - } - elseif (\array_key_exists('phone_office', $data) && $data['phone_office'] === null) { + } elseif (\array_key_exists('phone_office', $data) && null === $data['phone_office']) { $object->setPhoneOffice(null); } - if (\array_key_exists('phone_mobile', $data) && $data['phone_mobile'] !== null) { + if (\array_key_exists('phone_mobile', $data) && null !== $data['phone_mobile']) { $object->setPhoneMobile($data['phone_mobile']); - } - elseif (\array_key_exists('phone_mobile', $data) && $data['phone_mobile'] === null) { + } elseif (\array_key_exists('phone_mobile', $data) && null === $data['phone_mobile']) { $object->setPhoneMobile(null); } - if (\array_key_exists('fax', $data) && $data['fax'] !== null) { + if (\array_key_exists('fax', $data) && null !== $data['fax']) { $object->setFax($data['fax']); - } - elseif (\array_key_exists('fax', $data) && $data['fax'] === null) { + } elseif (\array_key_exists('fax', $data) && null === $data['fax']) { $object->setFax(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['client_id'] = $object->getClientId(); if (null !== $object->getTitle()) { $data['title'] = $object->getTitle(); @@ -118,6 +128,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getFax()) { $data['fax'] = $object->getFax(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/CostRateNormalizer.php b/generated/Normalizer/CostRateNormalizer.php index cf35876..c176072 100644 --- a/generated/Normalizer/CostRateNormalizer.php +++ b/generated/Normalizer/CostRateNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class CostRateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\CostRate'; + return 'JoliCode\\Harvest\\Api\\Model\\CostRate' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\CostRate'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\CostRate' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,50 +55,49 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('start_date', $data) && $data['start_date'] !== 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)); - } - elseif (\array_key_exists('start_date', $data) && $data['start_date'] === null) { + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } - if (\array_key_exists('end_date', $data) && $data['end_date'] !== 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)); - } - elseif (\array_key_exists('end_date', $data) && $data['end_date'] === null) { + } elseif (\array_key_exists('end_date', $data) && null === $data['end_date']) { $object->setEndDate(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -104,6 +116,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/CostRatesNormalizer.php b/generated/Normalizer/CostRatesNormalizer.php index a1c906d..2a6602d 100644 --- a/generated/Normalizer/CostRatesNormalizer.php +++ b/generated/Normalizer/CostRatesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class CostRatesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\CostRates'; + return 'JoliCode\\Harvest\\Api\\Model\\CostRates' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\CostRates'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\CostRates' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('cost_rates', $data)) { - $values = array(); + $values = []; foreach ($data['cost_rates'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\CostRate', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getCostRates() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ErrorNormalizer.php b/generated/Normalizer/ErrorNormalizer.php index a36d416..88d7551 100644 --- a/generated/Normalizer/ErrorNormalizer.php +++ b/generated/Normalizer/ErrorNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ErrorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Error'; + return 'JoliCode\\Harvest\\Api\\Model\\Error' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Error'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Error' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -48,20 +61,26 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('message', $data)) { $object->setMessage($data['message']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getCode()) { $data['code'] = $object->getCode(); } if (null !== $object->getMessage()) { $data['message'] = $object->getMessage(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateClientNormalizer.php b/generated/Normalizer/EstimateClientNormalizer.php index 1653cdd..b84bc7c 100644 --- a/generated/Normalizer/EstimateClientNormalizer.php +++ b/generated/Normalizer/EstimateClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateClient'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateCreatorNormalizer.php b/generated/Normalizer/EstimateCreatorNormalizer.php index c9e25ba..d90f3d5 100644 --- a/generated/Normalizer/EstimateCreatorNormalizer.php +++ b/generated/Normalizer/EstimateCreatorNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateCreatorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php b/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php index 65a3b67..e5547bf 100644 --- a/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateItemCategoriesEstimateItemCategoryIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesEstimateItemCategoryIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,23 +55,28 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateItemCategoriesNormalizer.php b/generated/Normalizer/EstimateItemCategoriesNormalizer.php index 65332dd..11c21e8 100644 --- a/generated/Normalizer/EstimateItemCategoriesNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoriesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateItemCategoriesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategories' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('estimate_item_categories', $data)) { - $values = array(); + $values = []; foreach ($data['estimate_item_categories'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getEstimateItemCategories() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php b/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php index 56219c3..5f654d1 100644 --- a/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoriesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateItemCategoriesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategoriesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,21 +55,26 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['name'] = $object->getName(); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateItemCategoryNormalizer.php b/generated/Normalizer/EstimateItemCategoryNormalizer.php index b0f644f..a170671 100644 --- a/generated/Normalizer/EstimateItemCategoryNormalizer.php +++ b/generated/Normalizer/EstimateItemCategoryNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateItemCategoryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateItemCategory' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateLineItemNormalizer.php b/generated/Normalizer/EstimateLineItemNormalizer.php index a9ecfb6..3bd2b91 100644 --- a/generated/Normalizer/EstimateLineItemNormalizer.php +++ b/generated/Normalizer/EstimateLineItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateLineItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,62 +55,59 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('kind', $data) && $data['kind'] !== null) { + if (\array_key_exists('kind', $data) && null !== $data['kind']) { $object->setKind($data['kind']); - } - elseif (\array_key_exists('kind', $data) && $data['kind'] === null) { + } elseif (\array_key_exists('kind', $data) && null === $data['kind']) { $object->setKind(null); } - if (\array_key_exists('description', $data) && $data['description'] !== null) { + if (\array_key_exists('description', $data) && null !== $data['description']) { $object->setDescription($data['description']); - } - elseif (\array_key_exists('description', $data) && $data['description'] === null) { + } elseif (\array_key_exists('description', $data) && null === $data['description']) { $object->setDescription(null); } - if (\array_key_exists('quantity', $data) && $data['quantity'] !== null) { + if (\array_key_exists('quantity', $data) && null !== $data['quantity']) { $object->setQuantity($data['quantity']); - } - elseif (\array_key_exists('quantity', $data) && $data['quantity'] === null) { + } elseif (\array_key_exists('quantity', $data) && null === $data['quantity']) { $object->setQuantity(null); } - if (\array_key_exists('unit_price', $data) && $data['unit_price'] !== null) { + if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); - } - elseif (\array_key_exists('unit_price', $data) && $data['unit_price'] === null) { + } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('taxed', $data) && $data['taxed'] !== null) { + if (\array_key_exists('taxed', $data) && null !== $data['taxed']) { $object->setTaxed($data['taxed']); - } - elseif (\array_key_exists('taxed', $data) && $data['taxed'] === null) { + } elseif (\array_key_exists('taxed', $data) && null === $data['taxed']) { $object->setTaxed(null); } - if (\array_key_exists('taxed2', $data) && $data['taxed2'] !== null) { + if (\array_key_exists('taxed2', $data) && null !== $data['taxed2']) { $object->setTaxed2($data['taxed2']); - } - elseif (\array_key_exists('taxed2', $data) && $data['taxed2'] === null) { + } elseif (\array_key_exists('taxed2', $data) && null === $data['taxed2']) { $object->setTaxed2(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -122,6 +132,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateLineItemsNormalizer.php b/generated/Normalizer/EstimateLineItemsNormalizer.php index 66e4ee1..63058f3 100644 --- a/generated/Normalizer/EstimateLineItemsNormalizer.php +++ b/generated/Normalizer/EstimateLineItemsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateLineItemsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItems' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('estimate_line_items', $data)) { - $values = array(); + $values = []; foreach ($data['estimate_line_items'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateLineItem', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getEstimateLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateMessageNormalizer.php b/generated/Normalizer/EstimateMessageNormalizer.php index 622f667..5fc18b1 100644 --- a/generated/Normalizer/EstimateMessageNormalizer.php +++ b/generated/Normalizer/EstimateMessageNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateMessageNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,90 +55,83 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('sent_by', $data) && $data['sent_by'] !== null) { + if (\array_key_exists('sent_by', $data) && null !== $data['sent_by']) { $object->setSentBy($data['sent_by']); - } - elseif (\array_key_exists('sent_by', $data) && $data['sent_by'] === null) { + } elseif (\array_key_exists('sent_by', $data) && null === $data['sent_by']) { $object->setSentBy(null); } - if (\array_key_exists('sent_by_email', $data) && $data['sent_by_email'] !== null) { + if (\array_key_exists('sent_by_email', $data) && null !== $data['sent_by_email']) { $object->setSentByEmail($data['sent_by_email']); - } - elseif (\array_key_exists('sent_by_email', $data) && $data['sent_by_email'] === null) { + } elseif (\array_key_exists('sent_by_email', $data) && null === $data['sent_by_email']) { $object->setSentByEmail(null); } - if (\array_key_exists('sent_from', $data) && $data['sent_from'] !== null) { + if (\array_key_exists('sent_from', $data) && null !== $data['sent_from']) { $object->setSentFrom($data['sent_from']); - } - elseif (\array_key_exists('sent_from', $data) && $data['sent_from'] === null) { + } elseif (\array_key_exists('sent_from', $data) && null === $data['sent_from']) { $object->setSentFrom(null); } - if (\array_key_exists('sent_from_email', $data) && $data['sent_from_email'] !== null) { + if (\array_key_exists('sent_from_email', $data) && null !== $data['sent_from_email']) { $object->setSentFromEmail($data['sent_from_email']); - } - elseif (\array_key_exists('sent_from_email', $data) && $data['sent_from_email'] === null) { + } elseif (\array_key_exists('sent_from_email', $data) && null === $data['sent_from_email']) { $object->setSentFromEmail(null); } - if (\array_key_exists('recipients', $data) && $data['recipients'] !== null) { - $values = array(); + if (\array_key_exists('recipients', $data) && null !== $data['recipients']) { + $values = []; foreach ($data['recipients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient', 'json', $context); } $object->setRecipients($values); - } - elseif (\array_key_exists('recipients', $data) && $data['recipients'] === null) { + } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('body', $data) && $data['body'] !== null) { + if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); - } - elseif (\array_key_exists('body', $data) && $data['body'] === null) { + } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } - if (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] !== null) { + if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); - } - elseif (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] === null) { + } 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) && $data['event_type'] !== null) { + if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); - } - elseif (\array_key_exists('event_type', $data) && $data['event_type'] === null) { + } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -142,7 +148,7 @@ public function normalize($object, $format = null, array $context = array()) $data['sent_from_email'] = $object->getSentFromEmail(); } if (null !== $object->getRecipients()) { - $values = array(); + $values = []; foreach ($object->getRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -166,6 +172,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateMessageRecipientNormalizer.php b/generated/Normalizer/EstimateMessageRecipientNormalizer.php index 1a4e963..54cbfa3 100644 --- a/generated/Normalizer/EstimateMessageRecipientNormalizer.php +++ b/generated/Normalizer/EstimateMessageRecipientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateMessageRecipientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } if (null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateMessageRecipientsNormalizer.php b/generated/Normalizer/EstimateMessageRecipientsNormalizer.php index fdeda78..fec3db8 100644 --- a/generated/Normalizer/EstimateMessageRecipientsNormalizer.php +++ b/generated/Normalizer/EstimateMessageRecipientsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateMessageRecipientsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipients' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('estimate_message_recipients', $data)) { - $values = array(); + $values = []; foreach ($data['estimate_message_recipients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessageRecipient', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getEstimateMessageRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateMessagesNormalizer.php b/generated/Normalizer/EstimateMessagesNormalizer.php index 0a13068..3fe6c0a 100644 --- a/generated/Normalizer/EstimateMessagesNormalizer.php +++ b/generated/Normalizer/EstimateMessagesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimateMessages' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('estimate_messages', $data)) { - $values = array(); + $values = []; foreach ($data['estimate_messages'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimateMessage', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getEstimateMessages() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimateNormalizer.php b/generated/Normalizer/EstimateNormalizer.php index 791d498..7d75758 100644 --- a/generated/Normalizer/EstimateNormalizer.php +++ b/generated/Normalizer/EstimateNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Estimate'; + return 'JoliCode\\Harvest\\Api\\Model\\Estimate' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Estimate'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Estimate' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,162 +55,143 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\EstimateClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('line_items', $data) && $data['line_items'] !== null) { - $values = array(); + 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\\EstimateLineItem', 'json', $context); } $object->setLineItems($values); - } - elseif (\array_key_exists('line_items', $data) && $data['line_items'] === null) { + } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } - if (\array_key_exists('creator', $data) && $data['creator'] !== null) { + if (\array_key_exists('creator', $data) && null !== $data['creator']) { $object->setCreator($this->denormalizer->denormalize($data['creator'], 'JoliCode\\Harvest\\Api\\Model\\EstimateCreator', 'json', $context)); - } - elseif (\array_key_exists('creator', $data) && $data['creator'] === null) { + } elseif (\array_key_exists('creator', $data) && null === $data['creator']) { $object->setCreator(null); } - if (\array_key_exists('client_key', $data) && $data['client_key'] !== null) { + if (\array_key_exists('client_key', $data) && null !== $data['client_key']) { $object->setClientKey($data['client_key']); - } - elseif (\array_key_exists('client_key', $data) && $data['client_key'] === null) { + } elseif (\array_key_exists('client_key', $data) && null === $data['client_key']) { $object->setClientKey(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } - if (\array_key_exists('purchase_order', $data) && $data['purchase_order'] !== null) { + if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); - } - elseif (\array_key_exists('purchase_order', $data) && $data['purchase_order'] === null) { + } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('tax', $data) && $data['tax'] !== null) { + if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); - } - elseif (\array_key_exists('tax', $data) && $data['tax'] === null) { + } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } - if (\array_key_exists('tax_amount', $data) && $data['tax_amount'] !== null) { + if (\array_key_exists('tax_amount', $data) && null !== $data['tax_amount']) { $object->setTaxAmount($data['tax_amount']); - } - elseif (\array_key_exists('tax_amount', $data) && $data['tax_amount'] === null) { + } elseif (\array_key_exists('tax_amount', $data) && null === $data['tax_amount']) { $object->setTaxAmount(null); } - if (\array_key_exists('tax2', $data) && $data['tax2'] !== null) { + if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); - } - elseif (\array_key_exists('tax2', $data) && $data['tax2'] === null) { + } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } - if (\array_key_exists('tax2_amount', $data) && $data['tax2_amount'] !== null) { + if (\array_key_exists('tax2_amount', $data) && null !== $data['tax2_amount']) { $object->setTax2Amount($data['tax2_amount']); - } - elseif (\array_key_exists('tax2_amount', $data) && $data['tax2_amount'] === null) { + } elseif (\array_key_exists('tax2_amount', $data) && null === $data['tax2_amount']) { $object->setTax2Amount(null); } - if (\array_key_exists('discount', $data) && $data['discount'] !== null) { + if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); - } - elseif (\array_key_exists('discount', $data) && $data['discount'] === null) { + } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } - if (\array_key_exists('discount_amount', $data) && $data['discount_amount'] !== null) { + if (\array_key_exists('discount_amount', $data) && null !== $data['discount_amount']) { $object->setDiscountAmount($data['discount_amount']); - } - elseif (\array_key_exists('discount_amount', $data) && $data['discount_amount'] === null) { + } elseif (\array_key_exists('discount_amount', $data) && null === $data['discount_amount']) { $object->setDiscountAmount(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('state', $data) && $data['state'] !== null) { + if (\array_key_exists('state', $data) && null !== $data['state']) { $object->setState($data['state']); - } - elseif (\array_key_exists('state', $data) && $data['state'] === null) { + } elseif (\array_key_exists('state', $data) && null === $data['state']) { $object->setState(null); } - if (\array_key_exists('issue_date', $data) && $data['issue_date'] !== 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)); - } - elseif (\array_key_exists('issue_date', $data) && $data['issue_date'] === null) { + } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } - if (\array_key_exists('sent_at', $data) && $data['sent_at'] !== 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'])); - } - elseif (\array_key_exists('sent_at', $data) && $data['sent_at'] === null) { + } elseif (\array_key_exists('sent_at', $data) && null === $data['sent_at']) { $object->setSentAt(null); } - if (\array_key_exists('accepted_at', $data) && $data['accepted_at'] !== 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'])); - } - elseif (\array_key_exists('accepted_at', $data) && $data['accepted_at'] === null) { + } elseif (\array_key_exists('accepted_at', $data) && null === $data['accepted_at']) { $object->setAcceptedAt(null); } - if (\array_key_exists('declined_at', $data) && $data['declined_at'] !== 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'])); - } - elseif (\array_key_exists('declined_at', $data) && $data['declined_at'] === null) { + } elseif (\array_key_exists('declined_at', $data) && null === $data['declined_at']) { $object->setDeclinedAt(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -205,7 +199,7 @@ public function normalize($object, $format = null, array $context = array()) $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } if (null !== $object->getLineItems()) { - $values = array(); + $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -274,6 +268,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php index 5694981..401c30c 100644 --- a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesEstimateIdMessagesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,52 +55,52 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('event_type', $data) && $data['event_type'] !== null) { + if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); - } - elseif (\array_key_exists('event_type', $data) && $data['event_type'] === null) { + } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } - if (\array_key_exists('recipients', $data) && $data['recipients'] !== null) { - $values = array(); + if (\array_key_exists('recipients', $data) && null !== $data['recipients']) { + $values = []; foreach ($data['recipients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem', 'json', $context); } $object->setRecipients($values); - } - elseif (\array_key_exists('recipients', $data) && $data['recipients'] === null) { + } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('body', $data) && $data['body'] !== null) { + if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); - } - elseif (\array_key_exists('body', $data) && $data['body'] === null) { + } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } - if (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] !== null) { + if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); - } - elseif (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] === null) { + } elseif (\array_key_exists('send_me_a_copy', $data) && null === $data['send_me_a_copy']) { $object->setSendMeACopy(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getEventType()) { $data['event_type'] = $object->getEventType(); } - $values = array(); + $values = []; foreach ($object->getRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -101,6 +114,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getSendMeACopy()) { $data['send_me_a_copy'] = $object->getSendMeACopy(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php index aa373d0..1b0468c 100644 --- a/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesEstimateIdMessagesPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdMessagesPostBodyRecipientsItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -48,18 +61,24 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('email', $data)) { $object->setEmail($data['email']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } $data['email'] = $object->getEmail(); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php b/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php index 2eeefe0..9134445 100644 --- a/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdPatchBodyLineItemsItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesEstimateIdPatchBodyLineItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBodyLineItemsItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -63,14 +76,19 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -92,6 +110,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php b/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php index 486804c..7505483 100644 --- a/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php +++ b/generated/Normalizer/EstimatesEstimateIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesEstimateIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesEstimateIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,84 +55,78 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } - if (\array_key_exists('purchase_order', $data) && $data['purchase_order'] !== null) { + if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); - } - elseif (\array_key_exists('purchase_order', $data) && $data['purchase_order'] === null) { + } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } - if (\array_key_exists('tax', $data) && $data['tax'] !== null) { + if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); - } - elseif (\array_key_exists('tax', $data) && $data['tax'] === null) { + } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } - if (\array_key_exists('tax2', $data) && $data['tax2'] !== null) { + if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); - } - elseif (\array_key_exists('tax2', $data) && $data['tax2'] === null) { + } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } - if (\array_key_exists('discount', $data) && $data['discount'] !== null) { + if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); - } - elseif (\array_key_exists('discount', $data) && $data['discount'] === null) { + } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('issue_date', $data) && $data['issue_date'] !== 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)); - } - elseif (\array_key_exists('issue_date', $data) && $data['issue_date'] === null) { + } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } - if (\array_key_exists('line_items', $data) && $data['line_items'] !== null) { - $values = array(); + 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\\EstimatesEstimateIdPatchBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); - } - elseif (\array_key_exists('line_items', $data) && $data['line_items'] === null) { + } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -151,12 +158,13 @@ public function normalize($object, $format = null, array $context = array()) $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } if (null !== $object->getLineItems()) { - $values = array(); + $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesNormalizer.php b/generated/Normalizer/EstimatesNormalizer.php index 8293d91..0322e2e 100644 --- a/generated/Normalizer/EstimatesNormalizer.php +++ b/generated/Normalizer/EstimatesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Estimates'; + return 'JoliCode\\Harvest\\Api\\Model\\Estimates' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Estimates'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Estimates' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('estimates', $data)) { - $values = array(); + $values = []; foreach ($data['estimates'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Estimate', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getEstimates() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php b/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php index 1e30146..19b8471 100644 --- a/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/EstimatesPostBodyLineItemsItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesPostBodyLineItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBodyLineItemsItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -60,14 +73,19 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['kind'] = $object->getKind(); if (null !== $object->getDescription()) { $data['description'] = $object->getDescription(); @@ -82,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/EstimatesPostBodyNormalizer.php b/generated/Normalizer/EstimatesPostBodyNormalizer.php index c7ae6d5..6758515 100644 --- a/generated/Normalizer/EstimatesPostBodyNormalizer.php +++ b/generated/Normalizer/EstimatesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class EstimatesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\EstimatesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,84 +55,78 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } - if (\array_key_exists('purchase_order', $data) && $data['purchase_order'] !== null) { + if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); - } - elseif (\array_key_exists('purchase_order', $data) && $data['purchase_order'] === null) { + } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } - if (\array_key_exists('tax', $data) && $data['tax'] !== null) { + if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); - } - elseif (\array_key_exists('tax', $data) && $data['tax'] === null) { + } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } - if (\array_key_exists('tax2', $data) && $data['tax2'] !== null) { + if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); - } - elseif (\array_key_exists('tax2', $data) && $data['tax2'] === null) { + } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } - if (\array_key_exists('discount', $data) && $data['discount'] !== null) { + if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); - } - elseif (\array_key_exists('discount', $data) && $data['discount'] === null) { + } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('issue_date', $data) && $data['issue_date'] !== 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)); - } - elseif (\array_key_exists('issue_date', $data) && $data['issue_date'] === null) { + } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } - if (\array_key_exists('line_items', $data) && $data['line_items'] !== null) { - $values = array(); + 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\\EstimatesPostBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); - } - elseif (\array_key_exists('line_items', $data) && $data['line_items'] === null) { + } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['client_id'] = $object->getClientId(); if (null !== $object->getNumber()) { $data['number'] = $object->getNumber(); @@ -149,12 +156,13 @@ public function normalize($object, $format = null, array $context = array()) $data['issue_date'] = $object->getIssueDate()->format('Y-m-d'); } if (null !== $object->getLineItems()) { - $values = array(); + $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php b/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php index 1248c2b..a562a2c 100644 --- a/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseCategoriesExpenseCategoryIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesExpenseCategoryIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('unit_name', $data) && $data['unit_name'] !== null) { + if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); - } - elseif (\array_key_exists('unit_name', $data) && $data['unit_name'] === null) { + } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } - if (\array_key_exists('unit_price', $data) && $data['unit_price'] !== null) { + if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); - } - elseif (\array_key_exists('unit_price', $data) && $data['unit_price'] === null) { + } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseCategoriesNormalizer.php b/generated/Normalizer/ExpenseCategoriesNormalizer.php index 221dd2a..832e8e3 100644 --- a/generated/Normalizer/ExpenseCategoriesNormalizer.php +++ b/generated/Normalizer/ExpenseCategoriesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseCategoriesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategories' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('expense_categories', $data)) { - $values = array(); + $values = []; foreach ($data['expense_categories'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getExpenseCategories() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php b/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php index a3f055d..11fa00e 100644 --- a/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php +++ b/generated/Normalizer/ExpenseCategoriesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseCategoriesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategoriesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('unit_name', $data) && $data['unit_name'] !== null) { + if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); - } - elseif (\array_key_exists('unit_name', $data) && $data['unit_name'] === null) { + } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } - if (\array_key_exists('unit_price', $data) && $data['unit_price'] !== null) { + if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); - } - elseif (\array_key_exists('unit_price', $data) && $data['unit_price'] === null) { + } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['name'] = $object->getName(); if (null !== $object->getUnitName()) { $data['unit_name'] = $object->getUnitName(); @@ -84,6 +98,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseCategoryNormalizer.php b/generated/Normalizer/ExpenseCategoryNormalizer.php index 7fba3bf..1ab7ff3 100644 --- a/generated/Normalizer/ExpenseCategoryNormalizer.php +++ b/generated/Normalizer/ExpenseCategoryNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseCategoryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseCategory' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,56 +55,54 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('unit_name', $data) && $data['unit_name'] !== null) { + if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); - } - elseif (\array_key_exists('unit_name', $data) && $data['unit_name'] === null) { + } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } - if (\array_key_exists('unit_price', $data) && $data['unit_price'] !== null) { + if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); - } - elseif (\array_key_exists('unit_price', $data) && $data['unit_price'] === null) { + } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -113,6 +124,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseClientNormalizer.php b/generated/Normalizer/ExpenseClientNormalizer.php index a2768de..8335136 100644 --- a/generated/Normalizer/ExpenseClientNormalizer.php +++ b/generated/Normalizer/ExpenseClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php b/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php index 7368c92..04537c7 100644 --- a/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php +++ b/generated/Normalizer/ExpenseExpenseCategoryNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseExpenseCategoryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseExpenseCategory' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('unit_price', $data) && $data['unit_price'] !== null) { + if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); - } - elseif (\array_key_exists('unit_price', $data) && $data['unit_price'] === null) { + } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } - if (\array_key_exists('unit_name', $data) && $data['unit_name'] !== null) { + if (\array_key_exists('unit_name', $data) && null !== $data['unit_name']) { $object->setUnitName($data['unit_name']); - } - elseif (\array_key_exists('unit_name', $data) && $data['unit_name'] === null) { + } elseif (\array_key_exists('unit_name', $data) && null === $data['unit_name']) { $object->setUnitName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUnitName()) { $data['unit_name'] = $object->getUnitName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseInvoiceNormalizer.php b/generated/Normalizer/ExpenseInvoiceNormalizer.php index 3de8b22..10f4ced 100644 --- a/generated/Normalizer/ExpenseInvoiceNormalizer.php +++ b/generated/Normalizer/ExpenseInvoiceNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseInvoiceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseNormalizer.php b/generated/Normalizer/ExpenseNormalizer.php index b5273db..b2989fe 100644 --- a/generated/Normalizer/ExpenseNormalizer.php +++ b/generated/Normalizer/ExpenseNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Expense'; + return 'JoliCode\\Harvest\\Api\\Model\\Expense' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Expense'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Expense' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,125 +55,112 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('project', $data) && $data['project'] !== null) { + if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject', 'json', $context)); - } - elseif (\array_key_exists('project', $data) && $data['project'] === null) { + } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } - if (\array_key_exists('expense_category', $data) && $data['expense_category'] !== 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)); - } - elseif (\array_key_exists('expense_category', $data) && $data['expense_category'] === null) { + } elseif (\array_key_exists('expense_category', $data) && null === $data['expense_category']) { $object->setExpenseCategory(null); } - if (\array_key_exists('user', $data) && $data['user'] !== null) { + if (\array_key_exists('user', $data) && null !== $data['user']) { $object->setUser($this->denormalizer->denormalize($data['user'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser', 'json', $context)); - } - elseif (\array_key_exists('user', $data) && $data['user'] === null) { + } 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)); } - if (\array_key_exists('receipt', $data) && $data['receipt'] !== null) { + if (\array_key_exists('receipt', $data) && null !== $data['receipt']) { $object->setReceipt($this->denormalizer->denormalize($data['receipt'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt', 'json', $context)); - } - elseif (\array_key_exists('receipt', $data) && $data['receipt'] === null) { + } elseif (\array_key_exists('receipt', $data) && null === $data['receipt']) { $object->setReceipt(null); } - if (\array_key_exists('invoice', $data) && $data['invoice'] !== null) { + if (\array_key_exists('invoice', $data) && null !== $data['invoice']) { $object->setInvoice($this->denormalizer->denormalize($data['invoice'], 'JoliCode\\Harvest\\Api\\Model\\ExpenseInvoice', 'json', $context)); - } - elseif (\array_key_exists('invoice', $data) && $data['invoice'] === null) { + } elseif (\array_key_exists('invoice', $data) && null === $data['invoice']) { $object->setInvoice(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('units', $data) && $data['units'] !== null) { + if (\array_key_exists('units', $data) && null !== $data['units']) { $object->setUnits($data['units']); - } - elseif (\array_key_exists('units', $data) && $data['units'] === null) { + } elseif (\array_key_exists('units', $data) && null === $data['units']) { $object->setUnits(null); } - if (\array_key_exists('total_cost', $data) && $data['total_cost'] !== null) { + if (\array_key_exists('total_cost', $data) && null !== $data['total_cost']) { $object->setTotalCost($data['total_cost']); - } - elseif (\array_key_exists('total_cost', $data) && $data['total_cost'] === null) { + } elseif (\array_key_exists('total_cost', $data) && null === $data['total_cost']) { $object->setTotalCost(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('is_closed', $data) && $data['is_closed'] !== null) { + if (\array_key_exists('is_closed', $data) && null !== $data['is_closed']) { $object->setIsClosed($data['is_closed']); - } - elseif (\array_key_exists('is_closed', $data) && $data['is_closed'] === null) { + } elseif (\array_key_exists('is_closed', $data) && null === $data['is_closed']) { $object->setIsClosed(null); } - if (\array_key_exists('is_locked', $data) && $data['is_locked'] !== null) { + if (\array_key_exists('is_locked', $data) && null !== $data['is_locked']) { $object->setIsLocked($data['is_locked']); - } - elseif (\array_key_exists('is_locked', $data) && $data['is_locked'] === null) { + } elseif (\array_key_exists('is_locked', $data) && null === $data['is_locked']) { $object->setIsLocked(null); } - if (\array_key_exists('is_billed', $data) && $data['is_billed'] !== null) { + if (\array_key_exists('is_billed', $data) && null !== $data['is_billed']) { $object->setIsBilled($data['is_billed']); - } - elseif (\array_key_exists('is_billed', $data) && $data['is_billed'] === null) { + } elseif (\array_key_exists('is_billed', $data) && null === $data['is_billed']) { $object->setIsBilled(null); } - if (\array_key_exists('locked_reason', $data) && $data['locked_reason'] !== null) { + if (\array_key_exists('locked_reason', $data) && null !== $data['locked_reason']) { $object->setLockedReason($data['locked_reason']); - } - elseif (\array_key_exists('locked_reason', $data) && $data['locked_reason'] === null) { + } elseif (\array_key_exists('locked_reason', $data) && null === $data['locked_reason']) { $object->setLockedReason(null); } - if (\array_key_exists('spent_date', $data) && $data['spent_date'] !== 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)); - } - elseif (\array_key_exists('spent_date', $data) && $data['spent_date'] === null) { + } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -218,6 +218,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseProjectNormalizer.php b/generated/Normalizer/ExpenseProjectNormalizer.php index 003d17f..ce9053b 100644 --- a/generated/Normalizer/ExpenseProjectNormalizer.php +++ b/generated/Normalizer/ExpenseProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseProject' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCode()) { $data['code'] = $object->getCode(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseReceiptNormalizer.php b/generated/Normalizer/ExpenseReceiptNormalizer.php index ed52c25..f2a886f 100644 --- a/generated/Normalizer/ExpenseReceiptNormalizer.php +++ b/generated/Normalizer/ExpenseReceiptNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseReceiptNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseReceipt' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('url', $data) && $data['url'] !== null) { + if (\array_key_exists('url', $data) && null !== $data['url']) { $object->setUrl($data['url']); - } - elseif (\array_key_exists('url', $data) && $data['url'] === null) { + } elseif (\array_key_exists('url', $data) && null === $data['url']) { $object->setUrl(null); } - if (\array_key_exists('file_name', $data) && $data['file_name'] !== null) { + if (\array_key_exists('file_name', $data) && null !== $data['file_name']) { $object->setFileName($data['file_name']); - } - elseif (\array_key_exists('file_name', $data) && $data['file_name'] === null) { + } elseif (\array_key_exists('file_name', $data) && null === $data['file_name']) { $object->setFileName(null); } - if (\array_key_exists('file_size', $data) && $data['file_size'] !== null) { + if (\array_key_exists('file_size', $data) && null !== $data['file_size']) { $object->setFileSize($data['file_size']); - } - elseif (\array_key_exists('file_size', $data) && $data['file_size'] === null) { + } elseif (\array_key_exists('file_size', $data) && null === $data['file_size']) { $object->setFileSize(null); } - if (\array_key_exists('content_type', $data) && $data['content_type'] !== null) { + if (\array_key_exists('content_type', $data) && null !== $data['content_type']) { $object->setContentType($data['content_type']); - } - elseif (\array_key_exists('content_type', $data) && $data['content_type'] === null) { + } elseif (\array_key_exists('content_type', $data) && null === $data['content_type']) { $object->setContentType(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getUrl()) { $data['url'] = $object->getUrl(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getContentType()) { $data['content_type'] = $object->getContentType(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseReportsResultNormalizer.php b/generated/Normalizer/ExpenseReportsResultNormalizer.php index d199182..af43af2 100644 --- a/generated/Normalizer/ExpenseReportsResultNormalizer.php +++ b/generated/Normalizer/ExpenseReportsResultNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseReportsResultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,86 +55,79 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('client_name', $data) && $data['client_name'] !== null) { + if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); - } - elseif (\array_key_exists('client_name', $data) && $data['client_name'] === null) { + } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('project_name', $data) && $data['project_name'] !== null) { + if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); - } - elseif (\array_key_exists('project_name', $data) && $data['project_name'] === null) { + } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } - if (\array_key_exists('expense_category_id', $data) && $data['expense_category_id'] !== null) { + if (\array_key_exists('expense_category_id', $data) && null !== $data['expense_category_id']) { $object->setExpenseCategoryId($data['expense_category_id']); - } - elseif (\array_key_exists('expense_category_id', $data) && $data['expense_category_id'] === null) { + } elseif (\array_key_exists('expense_category_id', $data) && null === $data['expense_category_id']) { $object->setExpenseCategoryId(null); } - if (\array_key_exists('expense_category_name', $data) && $data['expense_category_name'] !== null) { + if (\array_key_exists('expense_category_name', $data) && null !== $data['expense_category_name']) { $object->setExpenseCategoryName($data['expense_category_name']); - } - elseif (\array_key_exists('expense_category_name', $data) && $data['expense_category_name'] === null) { + } elseif (\array_key_exists('expense_category_name', $data) && null === $data['expense_category_name']) { $object->setExpenseCategoryName(null); } - if (\array_key_exists('user_id', $data) && $data['user_id'] !== null) { + if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); - } - elseif (\array_key_exists('user_id', $data) && $data['user_id'] === null) { + } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } - if (\array_key_exists('user_name', $data) && $data['user_name'] !== null) { + if (\array_key_exists('user_name', $data) && null !== $data['user_name']) { $object->setUserName($data['user_name']); - } - elseif (\array_key_exists('user_name', $data) && $data['user_name'] === null) { + } elseif (\array_key_exists('user_name', $data) && null === $data['user_name']) { $object->setUserName(null); } - if (\array_key_exists('is_contractor', $data) && $data['is_contractor'] !== null) { + if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); - } - elseif (\array_key_exists('is_contractor', $data) && $data['is_contractor'] === null) { + } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } - if (\array_key_exists('total_amount', $data) && $data['total_amount'] !== null) { + if (\array_key_exists('total_amount', $data) && null !== $data['total_amount']) { $object->setTotalAmount($data['total_amount']); - } - elseif (\array_key_exists('total_amount', $data) && $data['total_amount'] === null) { + } elseif (\array_key_exists('total_amount', $data) && null === $data['total_amount']) { $object->setTotalAmount(null); } - if (\array_key_exists('billable_amount', $data) && $data['billable_amount'] !== null) { + if (\array_key_exists('billable_amount', $data) && null !== $data['billable_amount']) { $object->setBillableAmount($data['billable_amount']); - } - elseif (\array_key_exists('billable_amount', $data) && $data['billable_amount'] === null) { + } elseif (\array_key_exists('billable_amount', $data) && null === $data['billable_amount']) { $object->setBillableAmount(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -158,6 +164,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseReportsResultsNormalizer.php b/generated/Normalizer/ExpenseReportsResultsNormalizer.php index fe670e0..c1d5dd1 100644 --- a/generated/Normalizer/ExpenseReportsResultsNormalizer.php +++ b/generated/Normalizer/ExpenseReportsResultsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseReportsResultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResults' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('results', $data)) { - $values = array(); + $values = []; foreach ($data['results'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ExpenseReportsResult', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getResults() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpenseUserNormalizer.php b/generated/Normalizer/ExpenseUserNormalizer.php index c3b76fe..ffdfe98 100644 --- a/generated/Normalizer/ExpenseUserNormalizer.php +++ b/generated/Normalizer/ExpenseUserNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpenseUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpenseUser' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php b/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php index f3396b2..e1c52e3 100644 --- a/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ExpensesExpenseIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpensesExpenseIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpensesExpenseIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,68 +55,64 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('expense_category_id', $data) && $data['expense_category_id'] !== null) { + if (\array_key_exists('expense_category_id', $data) && null !== $data['expense_category_id']) { $object->setExpenseCategoryId($data['expense_category_id']); - } - elseif (\array_key_exists('expense_category_id', $data) && $data['expense_category_id'] === null) { + } elseif (\array_key_exists('expense_category_id', $data) && null === $data['expense_category_id']) { $object->setExpenseCategoryId(null); } - if (\array_key_exists('spent_date', $data) && $data['spent_date'] !== 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)); - } - elseif (\array_key_exists('spent_date', $data) && $data['spent_date'] === null) { + } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } - if (\array_key_exists('units', $data) && $data['units'] !== null) { + if (\array_key_exists('units', $data) && null !== $data['units']) { $object->setUnits($data['units']); - } - elseif (\array_key_exists('units', $data) && $data['units'] === null) { + } elseif (\array_key_exists('units', $data) && null === $data['units']) { $object->setUnits(null); } - if (\array_key_exists('total_cost', $data) && $data['total_cost'] !== null) { + if (\array_key_exists('total_cost', $data) && null !== $data['total_cost']) { $object->setTotalCost($data['total_cost']); - } - elseif (\array_key_exists('total_cost', $data) && $data['total_cost'] === null) { + } elseif (\array_key_exists('total_cost', $data) && null === $data['total_cost']) { $object->setTotalCost(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('receipt', $data) && $data['receipt'] !== null) { + if (\array_key_exists('receipt', $data) && null !== $data['receipt']) { $object->setReceipt($data['receipt']); - } - elseif (\array_key_exists('receipt', $data) && $data['receipt'] === null) { + } elseif (\array_key_exists('receipt', $data) && null === $data['receipt']) { $object->setReceipt(null); } - if (\array_key_exists('delete_receipt', $data) && $data['delete_receipt'] !== null) { + if (\array_key_exists('delete_receipt', $data) && null !== $data['delete_receipt']) { $object->setDeleteReceipt($data['delete_receipt']); - } - elseif (\array_key_exists('delete_receipt', $data) && $data['delete_receipt'] === null) { + } elseif (\array_key_exists('delete_receipt', $data) && null === $data['delete_receipt']) { $object->setDeleteReceipt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } @@ -131,6 +140,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getDeleteReceipt()) { $data['delete_receipt'] = $object->getDeleteReceipt(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpensesNormalizer.php b/generated/Normalizer/ExpensesNormalizer.php index a097a5f..9f1bd5c 100644 --- a/generated/Normalizer/ExpensesNormalizer.php +++ b/generated/Normalizer/ExpensesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpensesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Expenses'; + return 'JoliCode\\Harvest\\Api\\Model\\Expenses' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Expenses'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Expenses' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('expenses', $data)) { - $values = array(); + $values = []; foreach ($data['expenses'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Expense', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getExpenses() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ExpensesPostBodyNormalizer.php b/generated/Normalizer/ExpensesPostBodyNormalizer.php index 5307f41..1558c21 100644 --- a/generated/Normalizer/ExpensesPostBodyNormalizer.php +++ b/generated/Normalizer/ExpensesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ExpensesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ExpensesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,68 +55,64 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('user_id', $data) && $data['user_id'] !== null) { + if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); - } - elseif (\array_key_exists('user_id', $data) && $data['user_id'] === null) { + } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('expense_category_id', $data) && $data['expense_category_id'] !== null) { + if (\array_key_exists('expense_category_id', $data) && null !== $data['expense_category_id']) { $object->setExpenseCategoryId($data['expense_category_id']); - } - elseif (\array_key_exists('expense_category_id', $data) && $data['expense_category_id'] === null) { + } elseif (\array_key_exists('expense_category_id', $data) && null === $data['expense_category_id']) { $object->setExpenseCategoryId(null); } - if (\array_key_exists('spent_date', $data) && $data['spent_date'] !== 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)); - } - elseif (\array_key_exists('spent_date', $data) && $data['spent_date'] === null) { + } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } - if (\array_key_exists('units', $data) && $data['units'] !== null) { + if (\array_key_exists('units', $data) && null !== $data['units']) { $object->setUnits($data['units']); - } - elseif (\array_key_exists('units', $data) && $data['units'] === null) { + } elseif (\array_key_exists('units', $data) && null === $data['units']) { $object->setUnits(null); } - if (\array_key_exists('total_cost', $data) && $data['total_cost'] !== null) { + if (\array_key_exists('total_cost', $data) && null !== $data['total_cost']) { $object->setTotalCost($data['total_cost']); - } - elseif (\array_key_exists('total_cost', $data) && $data['total_cost'] === null) { + } elseif (\array_key_exists('total_cost', $data) && null === $data['total_cost']) { $object->setTotalCost(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('receipt', $data) && $data['receipt'] !== null) { + if (\array_key_exists('receipt', $data) && null !== $data['receipt']) { $object->setReceipt($data['receipt']); - } - elseif (\array_key_exists('receipt', $data) && $data['receipt'] === null) { + } elseif (\array_key_exists('receipt', $data) && null === $data['receipt']) { $object->setReceipt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getUserId()) { $data['user_id'] = $object->getUserId(); } @@ -125,6 +134,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getReceipt()) { $data['receipt'] = $object->getReceipt(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceClientNormalizer.php b/generated/Normalizer/InvoiceClientNormalizer.php index e381129..9954c1c 100644 --- a/generated/Normalizer/InvoiceClientNormalizer.php +++ b/generated/Normalizer/InvoiceClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceCreatorNormalizer.php b/generated/Normalizer/InvoiceCreatorNormalizer.php index 4154675..7bba886 100644 --- a/generated/Normalizer/InvoiceCreatorNormalizer.php +++ b/generated/Normalizer/InvoiceCreatorNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceCreatorNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceEstimateNormalizer.php b/generated/Normalizer/InvoiceEstimateNormalizer.php index a186ad1..032646c 100644 --- a/generated/Normalizer/InvoiceEstimateNormalizer.php +++ b/generated/Normalizer/InvoiceEstimateNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceEstimateNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,23 +55,28 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php b/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php index 1a9c2a0..c299f48 100644 --- a/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceItemCategoriesInvoiceItemCategoryIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesInvoiceItemCategoryIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,23 +55,28 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceItemCategoriesNormalizer.php b/generated/Normalizer/InvoiceItemCategoriesNormalizer.php index 98cbaf5..536d8dc 100644 --- a/generated/Normalizer/InvoiceItemCategoriesNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoriesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceItemCategoriesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategories' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('invoice_item_categories', $data)) { - $values = array(); + $values = []; foreach ($data['invoice_item_categories'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getInvoiceItemCategories() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php b/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php index e4d5f6c..b917ff9 100644 --- a/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoriesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceItemCategoriesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategoriesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,21 +55,26 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['name'] = $object->getName(); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceItemCategoryNormalizer.php b/generated/Normalizer/InvoiceItemCategoryNormalizer.php index 9ffed09..0acfdee 100644 --- a/generated/Normalizer/InvoiceItemCategoryNormalizer.php +++ b/generated/Normalizer/InvoiceItemCategoryNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceItemCategoryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceItemCategory' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,50 +55,49 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('use_as_service', $data) && $data['use_as_service'] !== null) { + if (\array_key_exists('use_as_service', $data) && null !== $data['use_as_service']) { $object->setUseAsService($data['use_as_service']); - } - elseif (\array_key_exists('use_as_service', $data) && $data['use_as_service'] === null) { + } elseif (\array_key_exists('use_as_service', $data) && null === $data['use_as_service']) { $object->setUseAsService(null); } - if (\array_key_exists('use_as_expense', $data) && $data['use_as_expense'] !== null) { + if (\array_key_exists('use_as_expense', $data) && null !== $data['use_as_expense']) { $object->setUseAsExpense($data['use_as_expense']); - } - elseif (\array_key_exists('use_as_expense', $data) && $data['use_as_expense'] === null) { + } elseif (\array_key_exists('use_as_expense', $data) && null === $data['use_as_expense']) { $object->setUseAsExpense(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -104,6 +116,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceLineItemNormalizer.php b/generated/Normalizer/InvoiceLineItemNormalizer.php index e31a1b6..135965a 100644 --- a/generated/Normalizer/InvoiceLineItemNormalizer.php +++ b/generated/Normalizer/InvoiceLineItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceLineItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,68 +55,64 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('project', $data) && $data['project'] !== null) { + if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject', 'json', $context)); - } - elseif (\array_key_exists('project', $data) && $data['project'] === null) { + } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } - if (\array_key_exists('kind', $data) && $data['kind'] !== null) { + if (\array_key_exists('kind', $data) && null !== $data['kind']) { $object->setKind($data['kind']); - } - elseif (\array_key_exists('kind', $data) && $data['kind'] === null) { + } elseif (\array_key_exists('kind', $data) && null === $data['kind']) { $object->setKind(null); } - if (\array_key_exists('description', $data) && $data['description'] !== null) { + if (\array_key_exists('description', $data) && null !== $data['description']) { $object->setDescription($data['description']); - } - elseif (\array_key_exists('description', $data) && $data['description'] === null) { + } elseif (\array_key_exists('description', $data) && null === $data['description']) { $object->setDescription(null); } - if (\array_key_exists('quantity', $data) && $data['quantity'] !== null) { + if (\array_key_exists('quantity', $data) && null !== $data['quantity']) { $object->setQuantity($data['quantity']); - } - elseif (\array_key_exists('quantity', $data) && $data['quantity'] === null) { + } elseif (\array_key_exists('quantity', $data) && null === $data['quantity']) { $object->setQuantity(null); } - if (\array_key_exists('unit_price', $data) && $data['unit_price'] !== null) { + if (\array_key_exists('unit_price', $data) && null !== $data['unit_price']) { $object->setUnitPrice($data['unit_price']); - } - elseif (\array_key_exists('unit_price', $data) && $data['unit_price'] === null) { + } elseif (\array_key_exists('unit_price', $data) && null === $data['unit_price']) { $object->setUnitPrice(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('taxed', $data) && $data['taxed'] !== null) { + if (\array_key_exists('taxed', $data) && null !== $data['taxed']) { $object->setTaxed($data['taxed']); - } - elseif (\array_key_exists('taxed', $data) && $data['taxed'] === null) { + } elseif (\array_key_exists('taxed', $data) && null === $data['taxed']) { $object->setTaxed(null); } - if (\array_key_exists('taxed2', $data) && $data['taxed2'] !== null) { + if (\array_key_exists('taxed2', $data) && null !== $data['taxed2']) { $object->setTaxed2($data['taxed2']); - } - elseif (\array_key_exists('taxed2', $data) && $data['taxed2'] === null) { + } elseif (\array_key_exists('taxed2', $data) && null === $data['taxed2']) { $object->setTaxed2(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -131,6 +140,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceLineItemProjectNormalizer.php b/generated/Normalizer/InvoiceLineItemProjectNormalizer.php index bcb2881..1aa0123 100644 --- a/generated/Normalizer/InvoiceLineItemProjectNormalizer.php +++ b/generated/Normalizer/InvoiceLineItemProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceLineItemProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItemProject' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCode()) { $data['code'] = $object->getCode(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceLineItemsNormalizer.php b/generated/Normalizer/InvoiceLineItemsNormalizer.php index 1f96c28..4764a71 100644 --- a/generated/Normalizer/InvoiceLineItemsNormalizer.php +++ b/generated/Normalizer/InvoiceLineItemsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceLineItemsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItems' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('invoice_line_items', $data)) { - $values = array(); + $values = []; foreach ($data['invoice_line_items'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceLineItem', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getInvoiceLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceMessageNormalizer.php b/generated/Normalizer/InvoiceMessageNormalizer.php index 7cb20db..8240d78 100644 --- a/generated/Normalizer/InvoiceMessageNormalizer.php +++ b/generated/Normalizer/InvoiceMessageNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceMessageNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,120 +55,108 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('sent_by', $data) && $data['sent_by'] !== null) { + if (\array_key_exists('sent_by', $data) && null !== $data['sent_by']) { $object->setSentBy($data['sent_by']); - } - elseif (\array_key_exists('sent_by', $data) && $data['sent_by'] === null) { + } elseif (\array_key_exists('sent_by', $data) && null === $data['sent_by']) { $object->setSentBy(null); } - if (\array_key_exists('sent_by_email', $data) && $data['sent_by_email'] !== null) { + if (\array_key_exists('sent_by_email', $data) && null !== $data['sent_by_email']) { $object->setSentByEmail($data['sent_by_email']); - } - elseif (\array_key_exists('sent_by_email', $data) && $data['sent_by_email'] === null) { + } elseif (\array_key_exists('sent_by_email', $data) && null === $data['sent_by_email']) { $object->setSentByEmail(null); } - if (\array_key_exists('sent_from', $data) && $data['sent_from'] !== null) { + if (\array_key_exists('sent_from', $data) && null !== $data['sent_from']) { $object->setSentFrom($data['sent_from']); - } - elseif (\array_key_exists('sent_from', $data) && $data['sent_from'] === null) { + } elseif (\array_key_exists('sent_from', $data) && null === $data['sent_from']) { $object->setSentFrom(null); } - if (\array_key_exists('sent_from_email', $data) && $data['sent_from_email'] !== null) { + if (\array_key_exists('sent_from_email', $data) && null !== $data['sent_from_email']) { $object->setSentFromEmail($data['sent_from_email']); - } - elseif (\array_key_exists('sent_from_email', $data) && $data['sent_from_email'] === null) { + } elseif (\array_key_exists('sent_from_email', $data) && null === $data['sent_from_email']) { $object->setSentFromEmail(null); } - if (\array_key_exists('recipients', $data) && $data['recipients'] !== null) { - $values = array(); + if (\array_key_exists('recipients', $data) && null !== $data['recipients']) { + $values = []; foreach ($data['recipients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient', 'json', $context); } $object->setRecipients($values); - } - elseif (\array_key_exists('recipients', $data) && $data['recipients'] === null) { + } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('body', $data) && $data['body'] !== null) { + if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); - } - elseif (\array_key_exists('body', $data) && $data['body'] === null) { + } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } - if (\array_key_exists('include_link_to_client_invoice', $data) && $data['include_link_to_client_invoice'] !== 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']); - } - elseif (\array_key_exists('include_link_to_client_invoice', $data) && $data['include_link_to_client_invoice'] === null) { + } 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) && $data['attach_pdf'] !== null) { + if (\array_key_exists('attach_pdf', $data) && null !== $data['attach_pdf']) { $object->setAttachPdf($data['attach_pdf']); - } - elseif (\array_key_exists('attach_pdf', $data) && $data['attach_pdf'] === null) { + } elseif (\array_key_exists('attach_pdf', $data) && null === $data['attach_pdf']) { $object->setAttachPdf(null); } - if (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] !== null) { + if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); - } - elseif (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] === null) { + } 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) && $data['thank_you'] !== null) { + if (\array_key_exists('thank_you', $data) && null !== $data['thank_you']) { $object->setThankYou($data['thank_you']); - } - elseif (\array_key_exists('thank_you', $data) && $data['thank_you'] === null) { + } elseif (\array_key_exists('thank_you', $data) && null === $data['thank_you']) { $object->setThankYou(null); } - if (\array_key_exists('event_type', $data) && $data['event_type'] !== null) { + if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); - } - elseif (\array_key_exists('event_type', $data) && $data['event_type'] === null) { + } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } - if (\array_key_exists('reminder', $data) && $data['reminder'] !== null) { + if (\array_key_exists('reminder', $data) && null !== $data['reminder']) { $object->setReminder($data['reminder']); - } - elseif (\array_key_exists('reminder', $data) && $data['reminder'] === null) { + } elseif (\array_key_exists('reminder', $data) && null === $data['reminder']) { $object->setReminder(null); } - if (\array_key_exists('send_reminder_on', $data) && $data['send_reminder_on'] !== 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)); - } - elseif (\array_key_exists('send_reminder_on', $data) && $data['send_reminder_on'] === null) { + } elseif (\array_key_exists('send_reminder_on', $data) && null === $data['send_reminder_on']) { $object->setSendReminderOn(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -172,7 +173,7 @@ public function normalize($object, $format = null, array $context = array()) $data['sent_from_email'] = $object->getSentFromEmail(); } if (null !== $object->getRecipients()) { - $values = array(); + $values = []; foreach ($object->getRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -211,6 +212,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceMessageRecipientNormalizer.php b/generated/Normalizer/InvoiceMessageRecipientNormalizer.php index 9d57228..794e959 100644 --- a/generated/Normalizer/InvoiceMessageRecipientNormalizer.php +++ b/generated/Normalizer/InvoiceMessageRecipientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceMessageRecipientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } if (null !== $object->getEmail()) { $data['email'] = $object->getEmail(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php b/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php index 7d349f0..33bbf77 100644 --- a/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php +++ b/generated/Normalizer/InvoiceMessageRecipientsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceMessageRecipientsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipients' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('invoice_message_recipients', $data)) { - $values = array(); + $values = []; foreach ($data['invoice_message_recipients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessageRecipient', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getInvoiceMessageRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceMessagesNormalizer.php b/generated/Normalizer/InvoiceMessagesNormalizer.php index 27a52a9..06e29fe 100644 --- a/generated/Normalizer/InvoiceMessagesNormalizer.php +++ b/generated/Normalizer/InvoiceMessagesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceMessagesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessages' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('invoice_messages', $data)) { - $values = array(); + $values = []; foreach ($data['invoice_messages'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoiceMessage', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getInvoiceMessages() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceNormalizer.php b/generated/Normalizer/InvoiceNormalizer.php index 87de351..06c27a0 100644 --- a/generated/Normalizer/InvoiceNormalizer.php +++ b/generated/Normalizer/InvoiceNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Invoice'; + return 'JoliCode\\Harvest\\Api\\Model\\Invoice' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Invoice'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Invoice' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,216 +55,188 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('line_items', $data) && $data['line_items'] !== null) { - $values = array(); + 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\\InvoiceLineItem', 'json', $context); } $object->setLineItems($values); - } - elseif (\array_key_exists('line_items', $data) && $data['line_items'] === null) { + } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } - if (\array_key_exists('estimate', $data) && $data['estimate'] !== null) { + if (\array_key_exists('estimate', $data) && null !== $data['estimate']) { $object->setEstimate($this->denormalizer->denormalize($data['estimate'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceEstimate', 'json', $context)); - } - elseif (\array_key_exists('estimate', $data) && $data['estimate'] === null) { + } elseif (\array_key_exists('estimate', $data) && null === $data['estimate']) { $object->setEstimate(null); } - if (\array_key_exists('retainer', $data) && $data['retainer'] !== null) { + if (\array_key_exists('retainer', $data) && null !== $data['retainer']) { $object->setRetainer($this->denormalizer->denormalize($data['retainer'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer', 'json', $context)); - } - elseif (\array_key_exists('retainer', $data) && $data['retainer'] === null) { + } elseif (\array_key_exists('retainer', $data) && null === $data['retainer']) { $object->setRetainer(null); } - if (\array_key_exists('creator', $data) && $data['creator'] !== null) { + if (\array_key_exists('creator', $data) && null !== $data['creator']) { $object->setCreator($this->denormalizer->denormalize($data['creator'], 'JoliCode\\Harvest\\Api\\Model\\InvoiceCreator', 'json', $context)); - } - elseif (\array_key_exists('creator', $data) && $data['creator'] === null) { + } elseif (\array_key_exists('creator', $data) && null === $data['creator']) { $object->setCreator(null); } - if (\array_key_exists('client_key', $data) && $data['client_key'] !== null) { + if (\array_key_exists('client_key', $data) && null !== $data['client_key']) { $object->setClientKey($data['client_key']); - } - elseif (\array_key_exists('client_key', $data) && $data['client_key'] === null) { + } elseif (\array_key_exists('client_key', $data) && null === $data['client_key']) { $object->setClientKey(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } - if (\array_key_exists('purchase_order', $data) && $data['purchase_order'] !== null) { + if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); - } - elseif (\array_key_exists('purchase_order', $data) && $data['purchase_order'] === null) { + } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('due_amount', $data) && $data['due_amount'] !== null) { + if (\array_key_exists('due_amount', $data) && null !== $data['due_amount']) { $object->setDueAmount($data['due_amount']); - } - elseif (\array_key_exists('due_amount', $data) && $data['due_amount'] === null) { + } elseif (\array_key_exists('due_amount', $data) && null === $data['due_amount']) { $object->setDueAmount(null); } - if (\array_key_exists('tax', $data) && $data['tax'] !== null) { + if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); - } - elseif (\array_key_exists('tax', $data) && $data['tax'] === null) { + } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } - if (\array_key_exists('tax_amount', $data) && $data['tax_amount'] !== null) { + if (\array_key_exists('tax_amount', $data) && null !== $data['tax_amount']) { $object->setTaxAmount($data['tax_amount']); - } - elseif (\array_key_exists('tax_amount', $data) && $data['tax_amount'] === null) { + } elseif (\array_key_exists('tax_amount', $data) && null === $data['tax_amount']) { $object->setTaxAmount(null); } - if (\array_key_exists('tax2', $data) && $data['tax2'] !== null) { + if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); - } - elseif (\array_key_exists('tax2', $data) && $data['tax2'] === null) { + } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } - if (\array_key_exists('tax2_amount', $data) && $data['tax2_amount'] !== null) { + if (\array_key_exists('tax2_amount', $data) && null !== $data['tax2_amount']) { $object->setTax2Amount($data['tax2_amount']); - } - elseif (\array_key_exists('tax2_amount', $data) && $data['tax2_amount'] === null) { + } elseif (\array_key_exists('tax2_amount', $data) && null === $data['tax2_amount']) { $object->setTax2Amount(null); } - if (\array_key_exists('discount', $data) && $data['discount'] !== null) { + if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); - } - elseif (\array_key_exists('discount', $data) && $data['discount'] === null) { + } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } - if (\array_key_exists('discount_amount', $data) && $data['discount_amount'] !== null) { + if (\array_key_exists('discount_amount', $data) && null !== $data['discount_amount']) { $object->setDiscountAmount($data['discount_amount']); - } - elseif (\array_key_exists('discount_amount', $data) && $data['discount_amount'] === null) { + } elseif (\array_key_exists('discount_amount', $data) && null === $data['discount_amount']) { $object->setDiscountAmount(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('state', $data) && $data['state'] !== null) { + if (\array_key_exists('state', $data) && null !== $data['state']) { $object->setState($data['state']); - } - elseif (\array_key_exists('state', $data) && $data['state'] === null) { + } elseif (\array_key_exists('state', $data) && null === $data['state']) { $object->setState(null); } - if (\array_key_exists('period_start', $data) && $data['period_start'] !== 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)); - } - elseif (\array_key_exists('period_start', $data) && $data['period_start'] === null) { + } elseif (\array_key_exists('period_start', $data) && null === $data['period_start']) { $object->setPeriodStart(null); } - if (\array_key_exists('period_end', $data) && $data['period_end'] !== 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)); - } - elseif (\array_key_exists('period_end', $data) && $data['period_end'] === null) { + } elseif (\array_key_exists('period_end', $data) && null === $data['period_end']) { $object->setPeriodEnd(null); } - if (\array_key_exists('issue_date', $data) && $data['issue_date'] !== 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)); - } - elseif (\array_key_exists('issue_date', $data) && $data['issue_date'] === null) { + } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } - if (\array_key_exists('due_date', $data) && $data['due_date'] !== 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)); - } - elseif (\array_key_exists('due_date', $data) && $data['due_date'] === null) { + } elseif (\array_key_exists('due_date', $data) && null === $data['due_date']) { $object->setDueDate(null); } - if (\array_key_exists('payment_term', $data) && $data['payment_term'] !== null) { + if (\array_key_exists('payment_term', $data) && null !== $data['payment_term']) { $object->setPaymentTerm($data['payment_term']); - } - elseif (\array_key_exists('payment_term', $data) && $data['payment_term'] === null) { + } elseif (\array_key_exists('payment_term', $data) && null === $data['payment_term']) { $object->setPaymentTerm(null); } - if (\array_key_exists('sent_at', $data) && $data['sent_at'] !== 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'])); - } - elseif (\array_key_exists('sent_at', $data) && $data['sent_at'] === null) { + } elseif (\array_key_exists('sent_at', $data) && null === $data['sent_at']) { $object->setSentAt(null); } - if (\array_key_exists('paid_at', $data) && $data['paid_at'] !== 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'])); - } - elseif (\array_key_exists('paid_at', $data) && $data['paid_at'] === null) { + } elseif (\array_key_exists('paid_at', $data) && null === $data['paid_at']) { $object->setPaidAt(null); } - if (\array_key_exists('paid_date', $data) && $data['paid_date'] !== 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)); - } - elseif (\array_key_exists('paid_date', $data) && $data['paid_date'] === null) { + } elseif (\array_key_exists('paid_date', $data) && null === $data['paid_date']) { $object->setPaidDate(null); } - if (\array_key_exists('closed_at', $data) && $data['closed_at'] !== 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'])); - } - elseif (\array_key_exists('closed_at', $data) && $data['closed_at'] === null) { + } elseif (\array_key_exists('closed_at', $data) && null === $data['closed_at']) { $object->setClosedAt(null); } - if (\array_key_exists('recurring_invoice_id', $data) && $data['recurring_invoice_id'] !== null) { + if (\array_key_exists('recurring_invoice_id', $data) && null !== $data['recurring_invoice_id']) { $object->setRecurringInvoiceId($data['recurring_invoice_id']); - } - elseif (\array_key_exists('recurring_invoice_id', $data) && $data['recurring_invoice_id'] === null) { + } elseif (\array_key_exists('recurring_invoice_id', $data) && null === $data['recurring_invoice_id']) { $object->setRecurringInvoiceId(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -259,7 +244,7 @@ public function normalize($object, $format = null, array $context = array()) $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } if (null !== $object->getLineItems()) { - $values = array(); + $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -355,6 +340,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicePaymentNormalizer.php b/generated/Normalizer/InvoicePaymentNormalizer.php index 74922bc..6f22c75 100644 --- a/generated/Normalizer/InvoicePaymentNormalizer.php +++ b/generated/Normalizer/InvoicePaymentNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicePaymentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,80 +55,74 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('paid_at', $data) && $data['paid_at'] !== 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'])); - } - elseif (\array_key_exists('paid_at', $data) && $data['paid_at'] === null) { + } elseif (\array_key_exists('paid_at', $data) && null === $data['paid_at']) { $object->setPaidAt(null); } - if (\array_key_exists('paid_date', $data) && $data['paid_date'] !== 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)); - } - elseif (\array_key_exists('paid_date', $data) && $data['paid_date'] === null) { + } elseif (\array_key_exists('paid_date', $data) && null === $data['paid_date']) { $object->setPaidDate(null); } - if (\array_key_exists('recorded_by', $data) && $data['recorded_by'] !== null) { + if (\array_key_exists('recorded_by', $data) && null !== $data['recorded_by']) { $object->setRecordedBy($data['recorded_by']); - } - elseif (\array_key_exists('recorded_by', $data) && $data['recorded_by'] === null) { + } elseif (\array_key_exists('recorded_by', $data) && null === $data['recorded_by']) { $object->setRecordedBy(null); } - if (\array_key_exists('recorded_by_email', $data) && $data['recorded_by_email'] !== null) { + if (\array_key_exists('recorded_by_email', $data) && null !== $data['recorded_by_email']) { $object->setRecordedByEmail($data['recorded_by_email']); - } - elseif (\array_key_exists('recorded_by_email', $data) && $data['recorded_by_email'] === null) { + } elseif (\array_key_exists('recorded_by_email', $data) && null === $data['recorded_by_email']) { $object->setRecordedByEmail(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('transaction_id', $data) && $data['transaction_id'] !== null) { + if (\array_key_exists('transaction_id', $data) && null !== $data['transaction_id']) { $object->setTransactionId($data['transaction_id']); - } - elseif (\array_key_exists('transaction_id', $data) && $data['transaction_id'] === null) { + } elseif (\array_key_exists('transaction_id', $data) && null === $data['transaction_id']) { $object->setTransactionId(null); } - if (\array_key_exists('payment_gateway', $data) && $data['payment_gateway'] !== 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)); - } - elseif (\array_key_exists('payment_gateway', $data) && $data['payment_gateway'] === null) { + } elseif (\array_key_exists('payment_gateway', $data) && null === $data['payment_gateway']) { $object->setPaymentGateway(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -149,6 +156,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php b/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php index 6d8cd8e..54f5d24 100644 --- a/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php +++ b/generated/Normalizer/InvoicePaymentPaymentGatewayNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicePaymentPaymentGatewayNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicePaymentPaymentGateway' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicePaymentsNormalizer.php b/generated/Normalizer/InvoicePaymentsNormalizer.php index d282399..edf9079 100644 --- a/generated/Normalizer/InvoicePaymentsNormalizer.php +++ b/generated/Normalizer/InvoicePaymentsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicePaymentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicePayments' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('invoice_payments', $data)) { - $values = array(); + $values = []; foreach ($data['invoice_payments'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoicePayment', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getInvoicePayments() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoiceRetainerNormalizer.php b/generated/Normalizer/InvoiceRetainerNormalizer.php index 41d0282..b70835d 100644 --- a/generated/Normalizer/InvoiceRetainerNormalizer.php +++ b/generated/Normalizer/InvoiceRetainerNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoiceRetainerNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoiceRetainer' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,23 +55,28 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php index e6266a4..6c2f4e3 100644 --- a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesInvoiceIdMessagesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,70 +55,67 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('event_type', $data) && $data['event_type'] !== null) { + if (\array_key_exists('event_type', $data) && null !== $data['event_type']) { $object->setEventType($data['event_type']); - } - elseif (\array_key_exists('event_type', $data) && $data['event_type'] === null) { + } elseif (\array_key_exists('event_type', $data) && null === $data['event_type']) { $object->setEventType(null); } - if (\array_key_exists('recipients', $data) && $data['recipients'] !== null) { - $values = array(); + if (\array_key_exists('recipients', $data) && null !== $data['recipients']) { + $values = []; foreach ($data['recipients'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem', 'json', $context); } $object->setRecipients($values); - } - elseif (\array_key_exists('recipients', $data) && $data['recipients'] === null) { + } elseif (\array_key_exists('recipients', $data) && null === $data['recipients']) { $object->setRecipients(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('body', $data) && $data['body'] !== null) { + if (\array_key_exists('body', $data) && null !== $data['body']) { $object->setBody($data['body']); - } - elseif (\array_key_exists('body', $data) && $data['body'] === null) { + } elseif (\array_key_exists('body', $data) && null === $data['body']) { $object->setBody(null); } - if (\array_key_exists('include_link_to_client_invoice', $data) && $data['include_link_to_client_invoice'] !== 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']); - } - elseif (\array_key_exists('include_link_to_client_invoice', $data) && $data['include_link_to_client_invoice'] === null) { + } 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) && $data['attach_pdf'] !== null) { + if (\array_key_exists('attach_pdf', $data) && null !== $data['attach_pdf']) { $object->setAttachPdf($data['attach_pdf']); - } - elseif (\array_key_exists('attach_pdf', $data) && $data['attach_pdf'] === null) { + } elseif (\array_key_exists('attach_pdf', $data) && null === $data['attach_pdf']) { $object->setAttachPdf(null); } - if (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] !== null) { + if (\array_key_exists('send_me_a_copy', $data) && null !== $data['send_me_a_copy']) { $object->setSendMeACopy($data['send_me_a_copy']); - } - elseif (\array_key_exists('send_me_a_copy', $data) && $data['send_me_a_copy'] === null) { + } 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) && $data['thank_you'] !== null) { + if (\array_key_exists('thank_you', $data) && null !== $data['thank_you']) { $object->setThankYou($data['thank_you']); - } - elseif (\array_key_exists('thank_you', $data) && $data['thank_you'] === null) { + } elseif (\array_key_exists('thank_you', $data) && null === $data['thank_you']) { $object->setThankYou(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getEventType()) { $data['event_type'] = $object->getEventType(); } - $values = array(); + $values = []; foreach ($object->getRecipients() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -128,6 +138,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getThankYou()) { $data['thank_you'] = $object->getThankYou(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php index 4766409..6c7bd43 100644 --- a/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesInvoiceIdMessagesPostBodyRecipientsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdMessagesPostBodyRecipientsItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -48,18 +61,24 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('email', $data)) { $object->setEmail($data['email']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } $data['email'] = $object->getEmail(); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php index 1924820..6c8b609 100644 --- a/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesInvoiceIdPatchBodyLineItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBodyLineItemsItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -66,14 +79,19 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -98,6 +116,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php index dd09fe5..d6bb0f8 100644 --- a/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesInvoiceIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,108 +55,98 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('retainer_id', $data) && $data['retainer_id'] !== null) { + if (\array_key_exists('retainer_id', $data) && null !== $data['retainer_id']) { $object->setRetainerId($data['retainer_id']); - } - elseif (\array_key_exists('retainer_id', $data) && $data['retainer_id'] === null) { + } elseif (\array_key_exists('retainer_id', $data) && null === $data['retainer_id']) { $object->setRetainerId(null); } - if (\array_key_exists('estimate_id', $data) && $data['estimate_id'] !== null) { + if (\array_key_exists('estimate_id', $data) && null !== $data['estimate_id']) { $object->setEstimateId($data['estimate_id']); - } - elseif (\array_key_exists('estimate_id', $data) && $data['estimate_id'] === null) { + } elseif (\array_key_exists('estimate_id', $data) && null === $data['estimate_id']) { $object->setEstimateId(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } - if (\array_key_exists('purchase_order', $data) && $data['purchase_order'] !== null) { + if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); - } - elseif (\array_key_exists('purchase_order', $data) && $data['purchase_order'] === null) { + } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } - if (\array_key_exists('tax', $data) && $data['tax'] !== null) { + if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); - } - elseif (\array_key_exists('tax', $data) && $data['tax'] === null) { + } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } - if (\array_key_exists('tax2', $data) && $data['tax2'] !== null) { + if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); - } - elseif (\array_key_exists('tax2', $data) && $data['tax2'] === null) { + } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } - if (\array_key_exists('discount', $data) && $data['discount'] !== null) { + if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); - } - elseif (\array_key_exists('discount', $data) && $data['discount'] === null) { + } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('issue_date', $data) && $data['issue_date'] !== 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)); - } - elseif (\array_key_exists('issue_date', $data) && $data['issue_date'] === null) { + } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } - if (\array_key_exists('due_date', $data) && $data['due_date'] !== 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)); - } - elseif (\array_key_exists('due_date', $data) && $data['due_date'] === null) { + } elseif (\array_key_exists('due_date', $data) && null === $data['due_date']) { $object->setDueDate(null); } - if (\array_key_exists('payment_term', $data) && $data['payment_term'] !== null) { + if (\array_key_exists('payment_term', $data) && null !== $data['payment_term']) { $object->setPaymentTerm($data['payment_term']); - } - elseif (\array_key_exists('payment_term', $data) && $data['payment_term'] === null) { + } elseif (\array_key_exists('payment_term', $data) && null === $data['payment_term']) { $object->setPaymentTerm(null); } - if (\array_key_exists('line_items', $data) && $data['line_items'] !== null) { - $values = array(); + 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\\InvoicesInvoiceIdPatchBodyLineItemsItem', 'json', $context); } $object->setLineItems($values); - } - elseif (\array_key_exists('line_items', $data) && $data['line_items'] === null) { + } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -187,12 +190,13 @@ public function normalize($object, $format = null, array $context = array()) $data['payment_term'] = $object->getPaymentTerm(); } if (null !== $object->getLineItems()) { - $values = array(); + $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php b/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php index f5a1006..521b694 100644 --- a/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php +++ b/generated/Normalizer/InvoicesInvoiceIdPaymentsPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesInvoiceIdPaymentsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesInvoiceIdPaymentsPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('paid_at', $data) && $data['paid_at'] !== 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'])); - } - elseif (\array_key_exists('paid_at', $data) && $data['paid_at'] === null) { + } elseif (\array_key_exists('paid_at', $data) && null === $data['paid_at']) { $object->setPaidAt(null); } - if (\array_key_exists('paid_date', $data) && $data['paid_date'] !== 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)); - } - elseif (\array_key_exists('paid_date', $data) && $data['paid_date'] === null) { + } elseif (\array_key_exists('paid_date', $data) && null === $data['paid_date']) { $object->setPaidDate(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['amount'] = $object->getAmount(); if (null !== $object->getPaidAt()) { $data['paid_at'] = $object->getPaidAt()->format('Y-m-d\\TH:i:s\\Z'); @@ -84,6 +98,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getNotes()) { $data['notes'] = $object->getNotes(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesNormalizer.php b/generated/Normalizer/InvoicesNormalizer.php index 950aaa8..2227b0c 100644 --- a/generated/Normalizer/InvoicesNormalizer.php +++ b/generated/Normalizer/InvoicesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Invoices'; + return 'JoliCode\\Harvest\\Api\\Model\\Invoices' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Invoices'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Invoices' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('invoices', $data)) { - $values = array(); + $values = []; foreach ($data['invoices'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Invoice', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getInvoices() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php index 1dfee21..ecd1836 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsImportExpensesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesPostBodyLineItemsImportExpensesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -54,14 +67,19 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('attach_receipt', $data)) { $object->setAttachReceipt($data['attach_receipt']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['summary_type'] = $object->getSummaryType(); if (null !== $object->getFrom()) { $data['from'] = $object->getFrom()->format('Y-m-d'); @@ -72,6 +90,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getAttachReceipt()) { $data['attach_receipt'] = $object->getAttachReceipt(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php index 995bc45..1f7514e 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsImportNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesPostBodyLineItemsImportNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImport' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('project_ids', $data)) { - $values = array(); + $values = []; foreach ($data['project_ids'] as $value) { $values[] = $value; } @@ -55,15 +68,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('expenses', $data)) { $object->setExpenses($this->denormalizer->denormalize($data['expenses'], 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportExpenses', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getProjectIds() as $value) { $values[] = $value; } @@ -74,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getExpenses()) { $data['expenses'] = $this->normalizer->normalize($object->getExpenses(), 'json', $context); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php index fb27a30..091dc84 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsImportTimeNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesPostBodyLineItemsImportTimeNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsImportTime' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -51,14 +64,19 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('to', $data)) { $object->setTo(\DateTime::createFromFormat('Y-m-d', $data['to'])->setTime(0, 0, 0)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['summary_type'] = $object->getSummaryType(); if (null !== $object->getFrom()) { $data['from'] = $object->getFrom()->format('Y-m-d'); @@ -66,6 +84,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTo()) { $data['to'] = $object->getTo()->format('Y-m-d'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php b/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php index 6a104b7..83dbe8f 100644 --- a/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyLineItemsItemNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesPostBodyLineItemsItemNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBodyLineItemsItem' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -63,14 +76,19 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('taxed2', $data)) { $object->setTaxed2($data['taxed2']); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } @@ -88,6 +106,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getTaxed2()) { $data['taxed2'] = $object->getTaxed2(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/InvoicesPostBodyNormalizer.php b/generated/Normalizer/InvoicesPostBodyNormalizer.php index cd3fa3a..5752ca0 100644 --- a/generated/Normalizer/InvoicesPostBodyNormalizer.php +++ b/generated/Normalizer/InvoicesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class InvoicesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\InvoicesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,114 +55,103 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('retainer_id', $data) && $data['retainer_id'] !== null) { + if (\array_key_exists('retainer_id', $data) && null !== $data['retainer_id']) { $object->setRetainerId($data['retainer_id']); - } - elseif (\array_key_exists('retainer_id', $data) && $data['retainer_id'] === null) { + } elseif (\array_key_exists('retainer_id', $data) && null === $data['retainer_id']) { $object->setRetainerId(null); } - if (\array_key_exists('estimate_id', $data) && $data['estimate_id'] !== null) { + if (\array_key_exists('estimate_id', $data) && null !== $data['estimate_id']) { $object->setEstimateId($data['estimate_id']); - } - elseif (\array_key_exists('estimate_id', $data) && $data['estimate_id'] === null) { + } elseif (\array_key_exists('estimate_id', $data) && null === $data['estimate_id']) { $object->setEstimateId(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } - if (\array_key_exists('purchase_order', $data) && $data['purchase_order'] !== null) { + if (\array_key_exists('purchase_order', $data) && null !== $data['purchase_order']) { $object->setPurchaseOrder($data['purchase_order']); - } - elseif (\array_key_exists('purchase_order', $data) && $data['purchase_order'] === null) { + } elseif (\array_key_exists('purchase_order', $data) && null === $data['purchase_order']) { $object->setPurchaseOrder(null); } - if (\array_key_exists('tax', $data) && $data['tax'] !== null) { + if (\array_key_exists('tax', $data) && null !== $data['tax']) { $object->setTax($data['tax']); - } - elseif (\array_key_exists('tax', $data) && $data['tax'] === null) { + } elseif (\array_key_exists('tax', $data) && null === $data['tax']) { $object->setTax(null); } - if (\array_key_exists('tax2', $data) && $data['tax2'] !== null) { + if (\array_key_exists('tax2', $data) && null !== $data['tax2']) { $object->setTax2($data['tax2']); - } - elseif (\array_key_exists('tax2', $data) && $data['tax2'] === null) { + } elseif (\array_key_exists('tax2', $data) && null === $data['tax2']) { $object->setTax2(null); } - if (\array_key_exists('discount', $data) && $data['discount'] !== null) { + if (\array_key_exists('discount', $data) && null !== $data['discount']) { $object->setDiscount($data['discount']); - } - elseif (\array_key_exists('discount', $data) && $data['discount'] === null) { + } elseif (\array_key_exists('discount', $data) && null === $data['discount']) { $object->setDiscount(null); } - if (\array_key_exists('subject', $data) && $data['subject'] !== null) { + if (\array_key_exists('subject', $data) && null !== $data['subject']) { $object->setSubject($data['subject']); - } - elseif (\array_key_exists('subject', $data) && $data['subject'] === null) { + } elseif (\array_key_exists('subject', $data) && null === $data['subject']) { $object->setSubject(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('issue_date', $data) && $data['issue_date'] !== 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)); - } - elseif (\array_key_exists('issue_date', $data) && $data['issue_date'] === null) { + } elseif (\array_key_exists('issue_date', $data) && null === $data['issue_date']) { $object->setIssueDate(null); } - if (\array_key_exists('due_date', $data) && $data['due_date'] !== 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)); - } - elseif (\array_key_exists('due_date', $data) && $data['due_date'] === null) { + } elseif (\array_key_exists('due_date', $data) && null === $data['due_date']) { $object->setDueDate(null); } - if (\array_key_exists('payment_term', $data) && $data['payment_term'] !== null) { + if (\array_key_exists('payment_term', $data) && null !== $data['payment_term']) { $object->setPaymentTerm($data['payment_term']); - } - elseif (\array_key_exists('payment_term', $data) && $data['payment_term'] === null) { + } elseif (\array_key_exists('payment_term', $data) && null === $data['payment_term']) { $object->setPaymentTerm(null); } - if (\array_key_exists('line_items_import', $data) && $data['line_items_import'] !== 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)); - } - elseif (\array_key_exists('line_items_import', $data) && $data['line_items_import'] === null) { + } elseif (\array_key_exists('line_items_import', $data) && null === $data['line_items_import']) { $object->setLineItemsImport(null); } - if (\array_key_exists('line_items', $data) && $data['line_items'] !== null) { - $values = array(); + 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); - } - elseif (\array_key_exists('line_items', $data) && $data['line_items'] === null) { + } elseif (\array_key_exists('line_items', $data) && null === $data['line_items']) { $object->setLineItems(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['client_id'] = $object->getClientId(); if (null !== $object->getRetainerId()) { $data['retainer_id'] = $object->getRetainerId(); @@ -194,12 +196,13 @@ public function normalize($object, $format = null, array $context = array()) $data['line_items_import'] = $this->normalizer->normalize($object->getLineItemsImport(), 'json', $context); } if (null !== $object->getLineItems()) { - $values = array(); + $values = []; foreach ($object->getLineItems() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['line_items'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/JaneObjectNormalizer.php b/generated/Normalizer/JaneObjectNormalizer.php index 1cdfde3..a39c207 100644 --- a/generated/Normalizer/JaneObjectNormalizer.php +++ b/generated/Normalizer/JaneObjectNormalizer.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; @@ -9,54 +18,66 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - protected $normalizers = array('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\\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\\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\\PaginationLinks' => 'JoliCode\\Harvest\\Api\\Normalizer\\PaginationLinksNormalizer', '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', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\JoliCode\\Harvest\\Api\\Runtime\\Normalizer\\ReferenceNormalizer'), $normalizersCache = array(); - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + 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\\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\\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\\PaginationLinks' => 'JoliCode\\Harvest\\Api\\Normalizer\\PaginationLinksNormalizer', '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', '\\Jane\\Component\\JsonSchemaRuntime\\Reference' => '\\JoliCode\\Harvest\\Api\\Runtime\\Normalizer\\ReferenceNormalizer']; + protected $normalizersCache = []; + + public function supportsDenormalization($data, $type, $format = null): bool { - return array_key_exists($type, $this->normalizers); + return \array_key_exists($type, $this->normalizers); } - /** - * @return bool - */ - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && array_key_exists(get_class($data), $this->normalizers); + return \is_object($data) && \array_key_exists(\get_class($data), $this->normalizers); } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $normalizerClass = $this->normalizers[get_class($object)]; + $normalizerClass = $this->normalizers[\get_class($object)]; $normalizer = $this->getNormalizer($normalizerClass); + return $normalizer->normalize($object, $format, $context); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { $denormalizerClass = $this->normalizers[$class]; $denormalizer = $this->getNormalizer($denormalizerClass); + return $denormalizer->denormalize($data, $class, $format, $context); } + private function getNormalizer(string $normalizerClass) { return $this->normalizersCache[$normalizerClass] ?? $this->initNormalizer($normalizerClass); } + private function initNormalizer(string $normalizerClass) { $normalizer = new $normalizerClass(); $normalizer->setNormalizer($this->normalizer); $normalizer->setDenormalizer($this->denormalizer); $this->normalizersCache[$normalizerClass] = $normalizer; + return $normalizer; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/PaginationLinksNormalizer.php b/generated/Normalizer/PaginationLinksNormalizer.php index ae08a34..31fb938 100644 --- a/generated/Normalizer/PaginationLinksNormalizer.php +++ b/generated/Normalizer/PaginationLinksNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class PaginationLinksNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks'; + return 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -48,26 +61,29 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('last', $data)) { $object->setLast($data['last']); } - if (\array_key_exists('previous', $data) && $data['previous'] !== null) { + if (\array_key_exists('previous', $data) && null !== $data['previous']) { $object->setPrevious($data['previous']); - } - elseif (\array_key_exists('previous', $data) && $data['previous'] === null) { + } elseif (\array_key_exists('previous', $data) && null === $data['previous']) { $object->setPrevious(null); } - if (\array_key_exists('next', $data) && $data['next'] !== null) { + if (\array_key_exists('next', $data) && null !== $data['next']) { $object->setNext($data['next']); - } - elseif (\array_key_exists('next', $data) && $data['next'] === null) { + } elseif (\array_key_exists('next', $data) && null === $data['next']) { $object->setNext(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['first'] = $object->getFirst(); $data['last'] = $object->getLast(); if (null !== $object->getPrevious()) { @@ -76,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getNext()) { $data['next'] = $object->getNext(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectAssignmentClientNormalizer.php b/generated/Normalizer/ProjectAssignmentClientNormalizer.php index 7f8fb92..b4bc422 100644 --- a/generated/Normalizer/ProjectAssignmentClientNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectAssignmentClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectAssignmentNormalizer.php b/generated/Normalizer/ProjectAssignmentNormalizer.php index f44aaf6..0dcb3c5 100644 --- a/generated/Normalizer/ProjectAssignmentNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectAssignmentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,84 +55,78 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] !== null) { + if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); - } - elseif (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] === null) { + } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } - if (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] !== null) { + if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); - } - elseif (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] === null) { + } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } - if (\array_key_exists('project', $data) && $data['project'] !== null) { + if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject', 'json', $context)); - } - elseif (\array_key_exists('project', $data) && $data['project'] === null) { + } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('task_assignments', $data) && $data['task_assignments'] !== null) { - $values = array(); + if (\array_key_exists('task_assignments', $data) && null !== $data['task_assignments']) { + $values = []; foreach ($data['task_assignments'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json', $context); } $object->setTaskAssignments($values); - } - elseif (\array_key_exists('task_assignments', $data) && $data['task_assignments'] === null) { + } elseif (\array_key_exists('task_assignments', $data) && null === $data['task_assignments']) { $object->setTaskAssignments(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -151,12 +158,13 @@ public function normalize($object, $format = null, array $context = array()) $data['client'] = $this->normalizer->normalize($object->getClient(), 'json', $context); } if (null !== $object->getTaskAssignments()) { - $values = array(); + $values = []; foreach ($object->getTaskAssignments() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['task_assignments'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectAssignmentProjectNormalizer.php b/generated/Normalizer/ProjectAssignmentProjectNormalizer.php index d635830..21dc36b 100644 --- a/generated/Normalizer/ProjectAssignmentProjectNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectAssignmentProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignmentProject' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCode()) { $data['code'] = $object->getCode(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectAssignmentsNormalizer.php b/generated/Normalizer/ProjectAssignmentsNormalizer.php index d8f2f04..7bd4611 100644 --- a/generated/Normalizer/ProjectAssignmentsNormalizer.php +++ b/generated/Normalizer/ProjectAssignmentsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectAssignmentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignments' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('project_assignments', $data)) { - $values = array(); + $values = []; foreach ($data['project_assignments'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ProjectAssignment', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getProjectAssignments() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectBudgetReportResultNormalizer.php b/generated/Normalizer/ProjectBudgetReportResultNormalizer.php index 3983819..0037b35 100644 --- a/generated/Normalizer/ProjectBudgetReportResultNormalizer.php +++ b/generated/Normalizer/ProjectBudgetReportResultNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectBudgetReportResultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,74 +55,69 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('client_name', $data) && $data['client_name'] !== null) { + if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); - } - elseif (\array_key_exists('client_name', $data) && $data['client_name'] === null) { + } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('project_name', $data) && $data['project_name'] !== null) { + if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); - } - elseif (\array_key_exists('project_name', $data) && $data['project_name'] === null) { + } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } - if (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] !== null) { + if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); - } - elseif (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] === null) { + } elseif (\array_key_exists('budget_is_monthly', $data) && null === $data['budget_is_monthly']) { $object->setBudgetIsMonthly(null); } - if (\array_key_exists('budget_by', $data) && $data['budget_by'] !== null) { + if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); - } - elseif (\array_key_exists('budget_by', $data) && $data['budget_by'] === null) { + } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('budget_spent', $data) && $data['budget_spent'] !== null) { + if (\array_key_exists('budget_spent', $data) && null !== $data['budget_spent']) { $object->setBudgetSpent($data['budget_spent']); - } - elseif (\array_key_exists('budget_spent', $data) && $data['budget_spent'] === null) { + } elseif (\array_key_exists('budget_spent', $data) && null === $data['budget_spent']) { $object->setBudgetSpent(null); } - if (\array_key_exists('budget_remaining', $data) && $data['budget_remaining'] !== null) { + if (\array_key_exists('budget_remaining', $data) && null !== $data['budget_remaining']) { $object->setBudgetRemaining($data['budget_remaining']); - } - elseif (\array_key_exists('budget_remaining', $data) && $data['budget_remaining'] === null) { + } elseif (\array_key_exists('budget_remaining', $data) && null === $data['budget_remaining']) { $object->setBudgetRemaining(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -140,6 +148,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getBudgetRemaining()) { $data['budget_remaining'] = $object->getBudgetRemaining(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php b/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php index 62e59c6..7ade66b 100644 --- a/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php +++ b/generated/Normalizer/ProjectBudgetReportResultsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectBudgetReportResultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResults' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('results', $data)) { - $values = array(); + $values = []; foreach ($data['results'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\ProjectBudgetReportResult', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getResults() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectClientNormalizer.php b/generated/Normalizer/ProjectClientNormalizer.php index aeaec0f..3ecb7ed 100644 --- a/generated/Normalizer/ProjectClientNormalizer.php +++ b/generated/Normalizer/ProjectClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectClient'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCurrency()) { $data['currency'] = $object->getCurrency(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectNormalizer.php b/generated/Normalizer/ProjectNormalizer.php index 1917800..6703a61 100644 --- a/generated/Normalizer/ProjectNormalizer.php +++ b/generated/Normalizer/ProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Project'; + return 'JoliCode\\Harvest\\Api\\Model\\Project' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Project'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Project' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,158 +55,139 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\ProjectClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_billable', $data) && $data['is_billable'] !== null) { + if (\array_key_exists('is_billable', $data) && null !== $data['is_billable']) { $object->setIsBillable($data['is_billable']); - } - elseif (\array_key_exists('is_billable', $data) && $data['is_billable'] === null) { + } elseif (\array_key_exists('is_billable', $data) && null === $data['is_billable']) { $object->setIsBillable(null); } - if (\array_key_exists('is_fixed_fee', $data) && $data['is_fixed_fee'] !== null) { + if (\array_key_exists('is_fixed_fee', $data) && null !== $data['is_fixed_fee']) { $object->setIsFixedFee($data['is_fixed_fee']); - } - elseif (\array_key_exists('is_fixed_fee', $data) && $data['is_fixed_fee'] === null) { + } elseif (\array_key_exists('is_fixed_fee', $data) && null === $data['is_fixed_fee']) { $object->setIsFixedFee(null); } - if (\array_key_exists('bill_by', $data) && $data['bill_by'] !== null) { + if (\array_key_exists('bill_by', $data) && null !== $data['bill_by']) { $object->setBillBy($data['bill_by']); - } - elseif (\array_key_exists('bill_by', $data) && $data['bill_by'] === null) { + } elseif (\array_key_exists('bill_by', $data) && null === $data['bill_by']) { $object->setBillBy(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('budget_by', $data) && $data['budget_by'] !== null) { + if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); - } - elseif (\array_key_exists('budget_by', $data) && $data['budget_by'] === null) { + } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } - if (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] !== null) { + if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); - } - elseif (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] === null) { + } 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) && $data['notify_when_over_budget'] !== null) { + if (\array_key_exists('notify_when_over_budget', $data) && null !== $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget($data['notify_when_over_budget']); - } - elseif (\array_key_exists('notify_when_over_budget', $data) && $data['notify_when_over_budget'] === null) { + } 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) && $data['over_budget_notification_percentage'] !== null) { + if (\array_key_exists('over_budget_notification_percentage', $data) && null !== $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage($data['over_budget_notification_percentage']); - } - elseif (\array_key_exists('over_budget_notification_percentage', $data) && $data['over_budget_notification_percentage'] === null) { + } 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) && $data['over_budget_notification_date'] !== 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)); - } - elseif (\array_key_exists('over_budget_notification_date', $data) && $data['over_budget_notification_date'] === null) { + } 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) && $data['show_budget_to_all'] !== null) { + if (\array_key_exists('show_budget_to_all', $data) && null !== $data['show_budget_to_all']) { $object->setShowBudgetToAll($data['show_budget_to_all']); - } - elseif (\array_key_exists('show_budget_to_all', $data) && $data['show_budget_to_all'] === null) { + } 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) && $data['cost_budget'] !== null) { + if (\array_key_exists('cost_budget', $data) && null !== $data['cost_budget']) { $object->setCostBudget($data['cost_budget']); - } - elseif (\array_key_exists('cost_budget', $data) && $data['cost_budget'] === null) { + } elseif (\array_key_exists('cost_budget', $data) && null === $data['cost_budget']) { $object->setCostBudget(null); } - if (\array_key_exists('cost_budget_include_expenses', $data) && $data['cost_budget_include_expenses'] !== null) { + if (\array_key_exists('cost_budget_include_expenses', $data) && null !== $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses($data['cost_budget_include_expenses']); - } - elseif (\array_key_exists('cost_budget_include_expenses', $data) && $data['cost_budget_include_expenses'] === null) { + } elseif (\array_key_exists('cost_budget_include_expenses', $data) && null === $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses(null); } - if (\array_key_exists('fee', $data) && $data['fee'] !== null) { + if (\array_key_exists('fee', $data) && null !== $data['fee']) { $object->setFee($data['fee']); - } - elseif (\array_key_exists('fee', $data) && $data['fee'] === null) { + } elseif (\array_key_exists('fee', $data) && null === $data['fee']) { $object->setFee(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('starts_on', $data) && $data['starts_on'] !== 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)); - } - elseif (\array_key_exists('starts_on', $data) && $data['starts_on'] === null) { + } elseif (\array_key_exists('starts_on', $data) && null === $data['starts_on']) { $object->setStartsOn(null); } - if (\array_key_exists('ends_on', $data) && $data['ends_on'] !== 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)); - } - elseif (\array_key_exists('ends_on', $data) && $data['ends_on'] === null) { + } elseif (\array_key_exists('ends_on', $data) && null === $data['ends_on']) { $object->setEndsOn(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -266,6 +260,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsNormalizer.php b/generated/Normalizer/ProjectsNormalizer.php index a3a3752..0b45d6b 100644 --- a/generated/Normalizer/ProjectsNormalizer.php +++ b/generated/Normalizer/ProjectsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Projects'; + return 'JoliCode\\Harvest\\Api\\Model\\Projects' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Projects'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Projects' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('projects', $data)) { - $values = array(); + $values = []; foreach ($data['projects'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Project', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getProjects() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsPostBodyNormalizer.php b/generated/Normalizer/ProjectsPostBodyNormalizer.php index ff213a4..5ad11a7 100644 --- a/generated/Normalizer/ProjectsPostBodyNormalizer.php +++ b/generated/Normalizer/ProjectsPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,134 +55,119 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_billable', $data) && $data['is_billable'] !== null) { + if (\array_key_exists('is_billable', $data) && null !== $data['is_billable']) { $object->setIsBillable($data['is_billable']); - } - elseif (\array_key_exists('is_billable', $data) && $data['is_billable'] === null) { + } elseif (\array_key_exists('is_billable', $data) && null === $data['is_billable']) { $object->setIsBillable(null); } - if (\array_key_exists('is_fixed_fee', $data) && $data['is_fixed_fee'] !== null) { + if (\array_key_exists('is_fixed_fee', $data) && null !== $data['is_fixed_fee']) { $object->setIsFixedFee($data['is_fixed_fee']); - } - elseif (\array_key_exists('is_fixed_fee', $data) && $data['is_fixed_fee'] === null) { + } elseif (\array_key_exists('is_fixed_fee', $data) && null === $data['is_fixed_fee']) { $object->setIsFixedFee(null); } - if (\array_key_exists('bill_by', $data) && $data['bill_by'] !== null) { + if (\array_key_exists('bill_by', $data) && null !== $data['bill_by']) { $object->setBillBy($data['bill_by']); - } - elseif (\array_key_exists('bill_by', $data) && $data['bill_by'] === null) { + } elseif (\array_key_exists('bill_by', $data) && null === $data['bill_by']) { $object->setBillBy(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('budget_by', $data) && $data['budget_by'] !== null) { + if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); - } - elseif (\array_key_exists('budget_by', $data) && $data['budget_by'] === null) { + } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } - if (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] !== null) { + if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); - } - elseif (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] === null) { + } 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) && $data['notify_when_over_budget'] !== null) { + if (\array_key_exists('notify_when_over_budget', $data) && null !== $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget($data['notify_when_over_budget']); - } - elseif (\array_key_exists('notify_when_over_budget', $data) && $data['notify_when_over_budget'] === null) { + } 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) && $data['over_budget_notification_percentage'] !== null) { + if (\array_key_exists('over_budget_notification_percentage', $data) && null !== $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage($data['over_budget_notification_percentage']); - } - elseif (\array_key_exists('over_budget_notification_percentage', $data) && $data['over_budget_notification_percentage'] === null) { + } 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) && $data['show_budget_to_all'] !== null) { + if (\array_key_exists('show_budget_to_all', $data) && null !== $data['show_budget_to_all']) { $object->setShowBudgetToAll($data['show_budget_to_all']); - } - elseif (\array_key_exists('show_budget_to_all', $data) && $data['show_budget_to_all'] === null) { + } 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) && $data['cost_budget'] !== null) { + if (\array_key_exists('cost_budget', $data) && null !== $data['cost_budget']) { $object->setCostBudget($data['cost_budget']); - } - elseif (\array_key_exists('cost_budget', $data) && $data['cost_budget'] === null) { + } elseif (\array_key_exists('cost_budget', $data) && null === $data['cost_budget']) { $object->setCostBudget(null); } - if (\array_key_exists('cost_budget_include_expenses', $data) && $data['cost_budget_include_expenses'] !== null) { + if (\array_key_exists('cost_budget_include_expenses', $data) && null !== $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses($data['cost_budget_include_expenses']); - } - elseif (\array_key_exists('cost_budget_include_expenses', $data) && $data['cost_budget_include_expenses'] === null) { + } elseif (\array_key_exists('cost_budget_include_expenses', $data) && null === $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses(null); } - if (\array_key_exists('fee', $data) && $data['fee'] !== null) { + if (\array_key_exists('fee', $data) && null !== $data['fee']) { $object->setFee($data['fee']); - } - elseif (\array_key_exists('fee', $data) && $data['fee'] === null) { + } elseif (\array_key_exists('fee', $data) && null === $data['fee']) { $object->setFee(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('starts_on', $data) && $data['starts_on'] !== 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)); - } - elseif (\array_key_exists('starts_on', $data) && $data['starts_on'] === null) { + } elseif (\array_key_exists('starts_on', $data) && null === $data['starts_on']) { $object->setStartsOn(null); } - if (\array_key_exists('ends_on', $data) && $data['ends_on'] !== 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)); - } - elseif (\array_key_exists('ends_on', $data) && $data['ends_on'] === null) { + } elseif (\array_key_exists('ends_on', $data) && null === $data['ends_on']) { $object->setEndsOn(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['client_id'] = $object->getClientId(); $data['name'] = $object->getName(); if (null !== $object->getCode()) { @@ -220,6 +218,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getEndsOn()) { $data['ends_on'] = $object->getEndsOn()->format('Y-m-d'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php index 9bbdcbf..0f06ca5 100644 --- a/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsProjectIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,134 +55,119 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_billable', $data) && $data['is_billable'] !== null) { + if (\array_key_exists('is_billable', $data) && null !== $data['is_billable']) { $object->setIsBillable($data['is_billable']); - } - elseif (\array_key_exists('is_billable', $data) && $data['is_billable'] === null) { + } elseif (\array_key_exists('is_billable', $data) && null === $data['is_billable']) { $object->setIsBillable(null); } - if (\array_key_exists('is_fixed_fee', $data) && $data['is_fixed_fee'] !== null) { + if (\array_key_exists('is_fixed_fee', $data) && null !== $data['is_fixed_fee']) { $object->setIsFixedFee($data['is_fixed_fee']); - } - elseif (\array_key_exists('is_fixed_fee', $data) && $data['is_fixed_fee'] === null) { + } elseif (\array_key_exists('is_fixed_fee', $data) && null === $data['is_fixed_fee']) { $object->setIsFixedFee(null); } - if (\array_key_exists('bill_by', $data) && $data['bill_by'] !== null) { + if (\array_key_exists('bill_by', $data) && null !== $data['bill_by']) { $object->setBillBy($data['bill_by']); - } - elseif (\array_key_exists('bill_by', $data) && $data['bill_by'] === null) { + } elseif (\array_key_exists('bill_by', $data) && null === $data['bill_by']) { $object->setBillBy(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('budget_by', $data) && $data['budget_by'] !== null) { + if (\array_key_exists('budget_by', $data) && null !== $data['budget_by']) { $object->setBudgetBy($data['budget_by']); - } - elseif (\array_key_exists('budget_by', $data) && $data['budget_by'] === null) { + } elseif (\array_key_exists('budget_by', $data) && null === $data['budget_by']) { $object->setBudgetBy(null); } - if (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] !== null) { + if (\array_key_exists('budget_is_monthly', $data) && null !== $data['budget_is_monthly']) { $object->setBudgetIsMonthly($data['budget_is_monthly']); - } - elseif (\array_key_exists('budget_is_monthly', $data) && $data['budget_is_monthly'] === null) { + } 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) && $data['notify_when_over_budget'] !== null) { + if (\array_key_exists('notify_when_over_budget', $data) && null !== $data['notify_when_over_budget']) { $object->setNotifyWhenOverBudget($data['notify_when_over_budget']); - } - elseif (\array_key_exists('notify_when_over_budget', $data) && $data['notify_when_over_budget'] === null) { + } 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) && $data['over_budget_notification_percentage'] !== null) { + if (\array_key_exists('over_budget_notification_percentage', $data) && null !== $data['over_budget_notification_percentage']) { $object->setOverBudgetNotificationPercentage($data['over_budget_notification_percentage']); - } - elseif (\array_key_exists('over_budget_notification_percentage', $data) && $data['over_budget_notification_percentage'] === null) { + } 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) && $data['show_budget_to_all'] !== null) { + if (\array_key_exists('show_budget_to_all', $data) && null !== $data['show_budget_to_all']) { $object->setShowBudgetToAll($data['show_budget_to_all']); - } - elseif (\array_key_exists('show_budget_to_all', $data) && $data['show_budget_to_all'] === null) { + } 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) && $data['cost_budget'] !== null) { + if (\array_key_exists('cost_budget', $data) && null !== $data['cost_budget']) { $object->setCostBudget($data['cost_budget']); - } - elseif (\array_key_exists('cost_budget', $data) && $data['cost_budget'] === null) { + } elseif (\array_key_exists('cost_budget', $data) && null === $data['cost_budget']) { $object->setCostBudget(null); } - if (\array_key_exists('cost_budget_include_expenses', $data) && $data['cost_budget_include_expenses'] !== null) { + if (\array_key_exists('cost_budget_include_expenses', $data) && null !== $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses($data['cost_budget_include_expenses']); - } - elseif (\array_key_exists('cost_budget_include_expenses', $data) && $data['cost_budget_include_expenses'] === null) { + } elseif (\array_key_exists('cost_budget_include_expenses', $data) && null === $data['cost_budget_include_expenses']) { $object->setCostBudgetIncludeExpenses(null); } - if (\array_key_exists('fee', $data) && $data['fee'] !== null) { + if (\array_key_exists('fee', $data) && null !== $data['fee']) { $object->setFee($data['fee']); - } - elseif (\array_key_exists('fee', $data) && $data['fee'] === null) { + } elseif (\array_key_exists('fee', $data) && null === $data['fee']) { $object->setFee(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('starts_on', $data) && $data['starts_on'] !== 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)); - } - elseif (\array_key_exists('starts_on', $data) && $data['starts_on'] === null) { + } elseif (\array_key_exists('starts_on', $data) && null === $data['starts_on']) { $object->setStartsOn(null); } - if (\array_key_exists('ends_on', $data) && $data['ends_on'] !== 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)); - } - elseif (\array_key_exists('ends_on', $data) && $data['ends_on'] === null) { + } elseif (\array_key_exists('ends_on', $data) && null === $data['ends_on']) { $object->setEndsOn(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -230,6 +228,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getEndsOn()) { $data['ends_on'] = $object->getEndsOn()->format('Y-m-d'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php index 97f2a12..d86ed85 100644 --- a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsProjectIdTaskAssignmentsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,44 +55,44 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('task_id', $data) && $data['task_id'] !== null) { + if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); - } - elseif (\array_key_exists('task_id', $data) && $data['task_id'] === null) { + } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['task_id'] = $object->getTaskId(); if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); @@ -93,6 +106,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php index 4e37118..40444cd 100644 --- a/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdTaskAssignmentsTaskAssignmentIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php index 37fda1e..6c7d05c 100644 --- a/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdUserAssignmentsPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsProjectIdUserAssignmentsPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,50 +55,49 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('user_id', $data) && $data['user_id'] !== null) { + if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); - } - elseif (\array_key_exists('user_id', $data) && $data['user_id'] === null) { + } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] !== null) { + if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); - } - elseif (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] === null) { + } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } - if (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] !== null) { + if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); - } - elseif (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] === null) { + } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['user_id'] = $object->getUserId(); if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); @@ -102,6 +114,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php b/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php index f2f16af..b1b6b59 100644 --- a/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php +++ b/generated/Normalizer/ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\ProjectsProjectIdUserAssignmentsUserAssignmentIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,44 +55,44 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] !== null) { + if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); - } - elseif (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] === null) { + } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } - if (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] !== null) { + if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); - } - elseif (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] === null) { + } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } @@ -95,6 +108,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getBudget()) { $data['budget'] = $object->getBudget(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/RoleNormalizer.php b/generated/Normalizer/RoleNormalizer.php index 61e7e01..5ea2508 100644 --- a/generated/Normalizer/RoleNormalizer.php +++ b/generated/Normalizer/RoleNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class RoleNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Role'; + return 'JoliCode\\Harvest\\Api\\Model\\Role' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Role'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Role' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,48 +55,48 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('user_ids', $data) && $data['user_ids'] !== null) { - $values = array(); + if (\array_key_exists('user_ids', $data) && null !== $data['user_ids']) { + $values = []; foreach ($data['user_ids'] as $value) { $values[] = $value; } $object->setUserIds($values); - } - elseif (\array_key_exists('user_ids', $data) && $data['user_ids'] === null) { + } elseif (\array_key_exists('user_ids', $data) && null === $data['user_ids']) { $object->setUserIds(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -91,7 +104,7 @@ public function normalize($object, $format = null, array $context = array()) $data['name'] = $object->getName(); } if (null !== $object->getUserIds()) { - $values = array(); + $values = []; foreach ($object->getUserIds() as $value) { $values[] = $value; } @@ -103,6 +116,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/RolesNormalizer.php b/generated/Normalizer/RolesNormalizer.php index 346dcba..9fba7b1 100644 --- a/generated/Normalizer/RolesNormalizer.php +++ b/generated/Normalizer/RolesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class RolesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Roles'; + return 'JoliCode\\Harvest\\Api\\Model\\Roles' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Roles'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Roles' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('roles', $data)) { - $values = array(); + $values = []; foreach ($data['roles'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Role', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getRoles() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/RolesPostBodyNormalizer.php b/generated/Normalizer/RolesPostBodyNormalizer.php index 11dc40f..d9be5de 100644 --- a/generated/Normalizer/RolesPostBodyNormalizer.php +++ b/generated/Normalizer/RolesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class RolesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\RolesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,42 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('user_ids', $data) && $data['user_ids'] !== null) { - $values = array(); + if (\array_key_exists('user_ids', $data) && null !== $data['user_ids']) { + $values = []; foreach ($data['user_ids'] as $value) { $values[] = $value; } $object->setUserIds($values); - } - elseif (\array_key_exists('user_ids', $data) && $data['user_ids'] === null) { + } elseif (\array_key_exists('user_ids', $data) && null === $data['user_ids']) { $object->setUserIds(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['name'] = $object->getName(); if (null !== $object->getUserIds()) { - $values = array(); + $values = []; foreach ($object->getUserIds() as $value) { $values[] = $value; } $data['user_ids'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php b/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php index 6077fb6..bd9ed94 100644 --- a/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php +++ b/generated/Normalizer/RolesRoleIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class RolesRoleIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\RolesRoleIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,40 +55,44 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('user_ids', $data) && $data['user_ids'] !== null) { - $values = array(); + if (\array_key_exists('user_ids', $data) && null !== $data['user_ids']) { + $values = []; foreach ($data['user_ids'] as $value) { $values[] = $value; } $object->setUserIds($values); - } - elseif (\array_key_exists('user_ids', $data) && $data['user_ids'] === null) { + } elseif (\array_key_exists('user_ids', $data) && null === $data['user_ids']) { $object->setUserIds(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } if (null !== $object->getUserIds()) { - $values = array(); + $values = []; foreach ($object->getUserIds() as $value) { $values[] = $value; } $data['user_ids'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TaskAssignmentNormalizer.php b/generated/Normalizer/TaskAssignmentNormalizer.php index 786ea5a..7973035 100644 --- a/generated/Normalizer/TaskAssignmentNormalizer.php +++ b/generated/Normalizer/TaskAssignmentNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TaskAssignmentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment'; + return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,68 +55,64 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('project', $data) && $data['project'] !== null) { + if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject', 'json', $context)); - } - elseif (\array_key_exists('project', $data) && $data['project'] === null) { + } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } - if (\array_key_exists('task', $data) && $data['task'] !== null) { + if (\array_key_exists('task', $data) && null !== $data['task']) { $object->setTask($this->denormalizer->denormalize($data['task'], 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask', 'json', $context)); - } - elseif (\array_key_exists('task', $data) && $data['task'] === null) { + } elseif (\array_key_exists('task', $data) && null === $data['task']) { $object->setTask(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -131,6 +140,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TaskAssignmentProjectNormalizer.php b/generated/Normalizer/TaskAssignmentProjectNormalizer.php index 50c37fa..13a1cd7 100644 --- a/generated/Normalizer/TaskAssignmentProjectNormalizer.php +++ b/generated/Normalizer/TaskAssignmentProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TaskAssignmentProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject'; + return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentProject' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCode()) { $data['code'] = $object->getCode(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TaskAssignmentTaskNormalizer.php b/generated/Normalizer/TaskAssignmentTaskNormalizer.php index 0fb665e..7631221 100644 --- a/generated/Normalizer/TaskAssignmentTaskNormalizer.php +++ b/generated/Normalizer/TaskAssignmentTaskNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TaskAssignmentTaskNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask'; + return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignmentTask' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TaskAssignmentsNormalizer.php b/generated/Normalizer/TaskAssignmentsNormalizer.php index 240677f..1f858ac 100644 --- a/generated/Normalizer/TaskAssignmentsNormalizer.php +++ b/generated/Normalizer/TaskAssignmentsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TaskAssignmentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments'; + return 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TaskAssignments' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('task_assignments', $data)) { - $values = array(); + $values = []; foreach ($data['task_assignments'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TaskAssignment', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getTaskAssignments() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TaskNormalizer.php b/generated/Normalizer/TaskNormalizer.php index 6242c01..fc8cbf8 100644 --- a/generated/Normalizer/TaskNormalizer.php +++ b/generated/Normalizer/TaskNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TaskNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Task'; + return 'JoliCode\\Harvest\\Api\\Model\\Task' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Task'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Task' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,62 +55,59 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('billable_by_default', $data) && $data['billable_by_default'] !== null) { + if (\array_key_exists('billable_by_default', $data) && null !== $data['billable_by_default']) { $object->setBillableByDefault($data['billable_by_default']); - } - elseif (\array_key_exists('billable_by_default', $data) && $data['billable_by_default'] === null) { + } elseif (\array_key_exists('billable_by_default', $data) && null === $data['billable_by_default']) { $object->setBillableByDefault(null); } - if (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] !== null) { + if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); - } - elseif (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] === null) { + } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } - if (\array_key_exists('is_default', $data) && $data['is_default'] !== null) { + if (\array_key_exists('is_default', $data) && null !== $data['is_default']) { $object->setIsDefault($data['is_default']); - } - elseif (\array_key_exists('is_default', $data) && $data['is_default'] === null) { + } elseif (\array_key_exists('is_default', $data) && null === $data['is_default']) { $object->setIsDefault(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -122,6 +132,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TasksNormalizer.php b/generated/Normalizer/TasksNormalizer.php index 41d19c0..ba64b7e 100644 --- a/generated/Normalizer/TasksNormalizer.php +++ b/generated/Normalizer/TasksNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TasksNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Tasks'; + return 'JoliCode\\Harvest\\Api\\Model\\Tasks' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Tasks'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Tasks' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('tasks', $data)) { - $values = array(); + $values = []; foreach ($data['tasks'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\Task', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getTasks() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TasksPostBodyNormalizer.php b/generated/Normalizer/TasksPostBodyNormalizer.php index 1bf0977..91b0db3 100644 --- a/generated/Normalizer/TasksPostBodyNormalizer.php +++ b/generated/Normalizer/TasksPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TasksPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TasksPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,44 +55,44 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('billable_by_default', $data) && $data['billable_by_default'] !== null) { + if (\array_key_exists('billable_by_default', $data) && null !== $data['billable_by_default']) { $object->setBillableByDefault($data['billable_by_default']); - } - elseif (\array_key_exists('billable_by_default', $data) && $data['billable_by_default'] === null) { + } elseif (\array_key_exists('billable_by_default', $data) && null === $data['billable_by_default']) { $object->setBillableByDefault(null); } - if (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] !== null) { + if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); - } - elseif (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] === null) { + } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } - if (\array_key_exists('is_default', $data) && $data['is_default'] !== null) { + if (\array_key_exists('is_default', $data) && null !== $data['is_default']) { $object->setIsDefault($data['is_default']); - } - elseif (\array_key_exists('is_default', $data) && $data['is_default'] === null) { + } elseif (\array_key_exists('is_default', $data) && null === $data['is_default']) { $object->setIsDefault(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['name'] = $object->getName(); if (null !== $object->getBillableByDefault()) { $data['billable_by_default'] = $object->getBillableByDefault(); @@ -93,6 +106,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php b/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php index b05c384..aeb08ef 100644 --- a/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php +++ b/generated/Normalizer/TasksTaskIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TasksTaskIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TasksTaskIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,44 +55,44 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('billable_by_default', $data) && $data['billable_by_default'] !== null) { + if (\array_key_exists('billable_by_default', $data) && null !== $data['billable_by_default']) { $object->setBillableByDefault($data['billable_by_default']); - } - elseif (\array_key_exists('billable_by_default', $data) && $data['billable_by_default'] === null) { + } elseif (\array_key_exists('billable_by_default', $data) && null === $data['billable_by_default']) { $object->setBillableByDefault(null); } - if (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] !== null) { + if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); - } - elseif (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] === null) { + } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } - if (\array_key_exists('is_default', $data) && $data['is_default'] !== null) { + if (\array_key_exists('is_default', $data) && null !== $data['is_default']) { $object->setIsDefault($data['is_default']); - } - elseif (\array_key_exists('is_default', $data) && $data['is_default'] === null) { + } elseif (\array_key_exists('is_default', $data) && null === $data['is_default']) { $object->setIsDefault(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getName()) { $data['name'] = $object->getName(); } @@ -95,6 +108,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getIsActive()) { $data['is_active'] = $object->getIsActive(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntriesNormalizer.php b/generated/Normalizer/TimeEntriesNormalizer.php index 4912150..bd4709d 100644 --- a/generated/Normalizer/TimeEntriesNormalizer.php +++ b/generated/Normalizer/TimeEntriesNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntriesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntries'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntries' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntries'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntries' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('time_entries', $data)) { - $values = array(); + $values = []; foreach ($data['time_entries'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TimeEntry', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getTimeEntries() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php b/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php index 0507697..f9c26d1 100644 --- a/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php +++ b/generated/Normalizer/TimeEntriesPostBodyExternalReferenceNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntriesPostBodyExternalReferenceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBodyExternalReference' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('group_id', $data) && $data['group_id'] !== null) { + if (\array_key_exists('group_id', $data) && null !== $data['group_id']) { $object->setGroupId($data['group_id']); - } - elseif (\array_key_exists('group_id', $data) && $data['group_id'] === null) { + } elseif (\array_key_exists('group_id', $data) && null === $data['group_id']) { $object->setGroupId(null); } - if (\array_key_exists('account_id', $data) && $data['account_id'] !== null) { + if (\array_key_exists('account_id', $data) && null !== $data['account_id']) { $object->setAccountId($data['account_id']); - } - elseif (\array_key_exists('account_id', $data) && $data['account_id'] === null) { + } elseif (\array_key_exists('account_id', $data) && null === $data['account_id']) { $object->setAccountId(null); } - if (\array_key_exists('permalink', $data) && $data['permalink'] !== null) { + if (\array_key_exists('permalink', $data) && null !== $data['permalink']) { $object->setPermalink($data['permalink']); - } - elseif (\array_key_exists('permalink', $data) && $data['permalink'] === null) { + } elseif (\array_key_exists('permalink', $data) && null === $data['permalink']) { $object->setPermalink(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getPermalink()) { $data['permalink'] = $object->getPermalink(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntriesPostBodyNormalizer.php b/generated/Normalizer/TimeEntriesPostBodyNormalizer.php index d3cd663..94e6d79 100644 --- a/generated/Normalizer/TimeEntriesPostBodyNormalizer.php +++ b/generated/Normalizer/TimeEntriesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntriesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,68 +55,64 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('user_id', $data) && $data['user_id'] !== null) { + if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); - } - elseif (\array_key_exists('user_id', $data) && $data['user_id'] === null) { + } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('task_id', $data) && $data['task_id'] !== null) { + if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); - } - elseif (\array_key_exists('task_id', $data) && $data['task_id'] === null) { + } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } - if (\array_key_exists('spent_date', $data) && $data['spent_date'] !== 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)); - } - elseif (\array_key_exists('spent_date', $data) && $data['spent_date'] === null) { + } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } - if (\array_key_exists('started_time', $data) && $data['started_time'] !== null) { + if (\array_key_exists('started_time', $data) && null !== $data['started_time']) { $object->setStartedTime($data['started_time']); - } - elseif (\array_key_exists('started_time', $data) && $data['started_time'] === null) { + } elseif (\array_key_exists('started_time', $data) && null === $data['started_time']) { $object->setStartedTime(null); } - if (\array_key_exists('ended_time', $data) && $data['ended_time'] !== null) { + if (\array_key_exists('ended_time', $data) && null !== $data['ended_time']) { $object->setEndedTime($data['ended_time']); - } - elseif (\array_key_exists('ended_time', $data) && $data['ended_time'] === null) { + } elseif (\array_key_exists('ended_time', $data) && null === $data['ended_time']) { $object->setEndedTime(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('external_reference', $data) && $data['external_reference'] !== 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)); - } - elseif (\array_key_exists('external_reference', $data) && $data['external_reference'] === null) { + } elseif (\array_key_exists('external_reference', $data) && null === $data['external_reference']) { $object->setExternalReference(null); } - if (\array_key_exists('hours', $data) && $data['hours'] !== null) { + if (\array_key_exists('hours', $data) && null !== $data['hours']) { $object->setHours($data['hours']); - } - elseif (\array_key_exists('hours', $data) && $data['hours'] === null) { + } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { $object->setHours(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getUserId()) { $data['user_id'] = $object->getUserId(); } @@ -125,6 +134,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getHours()) { $data['hours'] = $object->getHours(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php index 00b4ff0..6533dc2 100644 --- a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php +++ b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntriesTimeEntryIdPatchBodyExternalReferenceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBodyExternalReference' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,38 +55,39 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('group_id', $data) && $data['group_id'] !== null) { + if (\array_key_exists('group_id', $data) && null !== $data['group_id']) { $object->setGroupId($data['group_id']); - } - elseif (\array_key_exists('group_id', $data) && $data['group_id'] === null) { + } elseif (\array_key_exists('group_id', $data) && null === $data['group_id']) { $object->setGroupId(null); } - if (\array_key_exists('account_id', $data) && $data['account_id'] !== null) { + if (\array_key_exists('account_id', $data) && null !== $data['account_id']) { $object->setAccountId($data['account_id']); - } - elseif (\array_key_exists('account_id', $data) && $data['account_id'] === null) { + } elseif (\array_key_exists('account_id', $data) && null === $data['account_id']) { $object->setAccountId(null); } - if (\array_key_exists('permalink', $data) && $data['permalink'] !== null) { + if (\array_key_exists('permalink', $data) && null !== $data['permalink']) { $object->setPermalink($data['permalink']); - } - elseif (\array_key_exists('permalink', $data) && $data['permalink'] === null) { + } elseif (\array_key_exists('permalink', $data) && null === $data['permalink']) { $object->setPermalink(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -86,6 +100,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getPermalink()) { $data['permalink'] = $object->getPermalink(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php index e84f8d0..eadcdad 100644 --- a/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php +++ b/generated/Normalizer/TimeEntriesTimeEntryIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntriesTimeEntryIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntriesTimeEntryIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,62 +55,59 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('task_id', $data) && $data['task_id'] !== null) { + if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); - } - elseif (\array_key_exists('task_id', $data) && $data['task_id'] === null) { + } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } - if (\array_key_exists('spent_date', $data) && $data['spent_date'] !== 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)); - } - elseif (\array_key_exists('spent_date', $data) && $data['spent_date'] === null) { + } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } - if (\array_key_exists('started_time', $data) && $data['started_time'] !== null) { + if (\array_key_exists('started_time', $data) && null !== $data['started_time']) { $object->setStartedTime($data['started_time']); - } - elseif (\array_key_exists('started_time', $data) && $data['started_time'] === null) { + } elseif (\array_key_exists('started_time', $data) && null === $data['started_time']) { $object->setStartedTime(null); } - if (\array_key_exists('ended_time', $data) && $data['ended_time'] !== null) { + if (\array_key_exists('ended_time', $data) && null !== $data['ended_time']) { $object->setEndedTime($data['ended_time']); - } - elseif (\array_key_exists('ended_time', $data) && $data['ended_time'] === null) { + } elseif (\array_key_exists('ended_time', $data) && null === $data['ended_time']) { $object->setEndedTime(null); } - if (\array_key_exists('hours', $data) && $data['hours'] !== null) { + if (\array_key_exists('hours', $data) && null !== $data['hours']) { $object->setHours($data['hours']); - } - elseif (\array_key_exists('hours', $data) && $data['hours'] === null) { + } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { $object->setHours(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('external_reference', $data) && $data['external_reference'] !== 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)); - } - elseif (\array_key_exists('external_reference', $data) && $data['external_reference'] === null) { + } elseif (\array_key_exists('external_reference', $data) && null === $data['external_reference']) { $object->setExternalReference(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getProjectId()) { $data['project_id'] = $object->getProjectId(); } @@ -122,6 +132,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getExternalReference()) { $data['external_reference'] = $this->normalizer->normalize($object->getExternalReference(), 'json', $context); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryClientNormalizer.php b/generated/Normalizer/TimeEntryClientNormalizer.php index d32d4c8..3085bfe 100644 --- a/generated/Normalizer/TimeEntryClientNormalizer.php +++ b/generated/Normalizer/TimeEntryClientNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryClientNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php b/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php index 08871a4..acca3c2 100644 --- a/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php +++ b/generated/Normalizer/TimeEntryExternalReferenceNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryExternalReferenceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryExternalReference' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,50 +55,49 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('group_id', $data) && $data['group_id'] !== null) { + if (\array_key_exists('group_id', $data) && null !== $data['group_id']) { $object->setGroupId($data['group_id']); - } - elseif (\array_key_exists('group_id', $data) && $data['group_id'] === null) { + } elseif (\array_key_exists('group_id', $data) && null === $data['group_id']) { $object->setGroupId(null); } - if (\array_key_exists('account_id', $data) && $data['account_id'] !== null) { + if (\array_key_exists('account_id', $data) && null !== $data['account_id']) { $object->setAccountId($data['account_id']); - } - elseif (\array_key_exists('account_id', $data) && $data['account_id'] === null) { + } elseif (\array_key_exists('account_id', $data) && null === $data['account_id']) { $object->setAccountId(null); } - if (\array_key_exists('permalink', $data) && $data['permalink'] !== null) { + if (\array_key_exists('permalink', $data) && null !== $data['permalink']) { $object->setPermalink($data['permalink']); - } - elseif (\array_key_exists('permalink', $data) && $data['permalink'] === null) { + } elseif (\array_key_exists('permalink', $data) && null === $data['permalink']) { $object->setPermalink(null); } - if (\array_key_exists('service', $data) && $data['service'] !== null) { + if (\array_key_exists('service', $data) && null !== $data['service']) { $object->setService($data['service']); - } - elseif (\array_key_exists('service', $data) && $data['service'] === null) { + } elseif (\array_key_exists('service', $data) && null === $data['service']) { $object->setService(null); } - if (\array_key_exists('service_icon_url', $data) && $data['service_icon_url'] !== null) { + if (\array_key_exists('service_icon_url', $data) && null !== $data['service_icon_url']) { $object->setServiceIconUrl($data['service_icon_url']); - } - elseif (\array_key_exists('service_icon_url', $data) && $data['service_icon_url'] === null) { + } elseif (\array_key_exists('service_icon_url', $data) && null === $data['service_icon_url']) { $object->setServiceIconUrl(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -104,6 +116,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getServiceIconUrl()) { $data['service_icon_url'] = $object->getServiceIconUrl(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryInvoiceNormalizer.php b/generated/Normalizer/TimeEntryInvoiceNormalizer.php index d8fc798..24a355c 100644 --- a/generated/Normalizer/TimeEntryInvoiceNormalizer.php +++ b/generated/Normalizer/TimeEntryInvoiceNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryInvoiceNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('number', $data) && $data['number'] !== null) { + if (\array_key_exists('number', $data) && null !== $data['number']) { $object->setNumber($data['number']); - } - elseif (\array_key_exists('number', $data) && $data['number'] === null) { + } elseif (\array_key_exists('number', $data) && null === $data['number']) { $object->setNumber(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getNumber()) { $data['number'] = $object->getNumber(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryNormalizer.php b/generated/Normalizer/TimeEntryNormalizer.php index 4258075..27bc42d 100644 --- a/generated/Normalizer/TimeEntryNormalizer.php +++ b/generated/Normalizer/TimeEntryNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntry'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntry' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntry'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntry' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,176 +55,155 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('spent_date', $data) && $data['spent_date'] !== 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)); - } - elseif (\array_key_exists('spent_date', $data) && $data['spent_date'] === null) { + } elseif (\array_key_exists('spent_date', $data) && null === $data['spent_date']) { $object->setSpentDate(null); } - if (\array_key_exists('user', $data) && $data['user'] !== null) { + if (\array_key_exists('user', $data) && null !== $data['user']) { $object->setUser($this->denormalizer->denormalize($data['user'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser', 'json', $context)); - } - elseif (\array_key_exists('user', $data) && $data['user'] === null) { + } 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)); } - if (\array_key_exists('client', $data) && $data['client'] !== null) { + if (\array_key_exists('client', $data) && null !== $data['client']) { $object->setClient($this->denormalizer->denormalize($data['client'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryClient', 'json', $context)); - } - elseif (\array_key_exists('client', $data) && $data['client'] === null) { + } elseif (\array_key_exists('client', $data) && null === $data['client']) { $object->setClient(null); } - if (\array_key_exists('project', $data) && $data['project'] !== null) { + if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject', 'json', $context)); - } - elseif (\array_key_exists('project', $data) && $data['project'] === null) { + } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } - if (\array_key_exists('task', $data) && $data['task'] !== null) { + if (\array_key_exists('task', $data) && null !== $data['task']) { $object->setTask($this->denormalizer->denormalize($data['task'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask', 'json', $context)); - } - elseif (\array_key_exists('task', $data) && $data['task'] === null) { + } 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)); } - if (\array_key_exists('external_reference', $data) && $data['external_reference'] !== null) { + 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)); - } - elseif (\array_key_exists('external_reference', $data) && $data['external_reference'] === null) { + } elseif (\array_key_exists('external_reference', $data) && null === $data['external_reference']) { $object->setExternalReference(null); } - if (\array_key_exists('invoice', $data) && $data['invoice'] !== null) { + if (\array_key_exists('invoice', $data) && null !== $data['invoice']) { $object->setInvoice($this->denormalizer->denormalize($data['invoice'], 'JoliCode\\Harvest\\Api\\Model\\TimeEntryInvoice', 'json', $context)); - } - elseif (\array_key_exists('invoice', $data) && $data['invoice'] === null) { + } elseif (\array_key_exists('invoice', $data) && null === $data['invoice']) { $object->setInvoice(null); } - if (\array_key_exists('hours', $data) && $data['hours'] !== null) { + if (\array_key_exists('hours', $data) && null !== $data['hours']) { $object->setHours($data['hours']); - } - elseif (\array_key_exists('hours', $data) && $data['hours'] === null) { + } elseif (\array_key_exists('hours', $data) && null === $data['hours']) { $object->setHours(null); } - if (\array_key_exists('hours_without_timer', $data) && $data['hours_without_timer'] !== null) { + if (\array_key_exists('hours_without_timer', $data) && null !== $data['hours_without_timer']) { $object->setHoursWithoutTimer($data['hours_without_timer']); - } - elseif (\array_key_exists('hours_without_timer', $data) && $data['hours_without_timer'] === null) { + } elseif (\array_key_exists('hours_without_timer', $data) && null === $data['hours_without_timer']) { $object->setHoursWithoutTimer(null); } - if (\array_key_exists('rounded_hours', $data) && $data['rounded_hours'] !== null) { + if (\array_key_exists('rounded_hours', $data) && null !== $data['rounded_hours']) { $object->setRoundedHours($data['rounded_hours']); - } - elseif (\array_key_exists('rounded_hours', $data) && $data['rounded_hours'] === null) { + } elseif (\array_key_exists('rounded_hours', $data) && null === $data['rounded_hours']) { $object->setRoundedHours(null); } - if (\array_key_exists('notes', $data) && $data['notes'] !== null) { + if (\array_key_exists('notes', $data) && null !== $data['notes']) { $object->setNotes($data['notes']); - } - elseif (\array_key_exists('notes', $data) && $data['notes'] === null) { + } elseif (\array_key_exists('notes', $data) && null === $data['notes']) { $object->setNotes(null); } - if (\array_key_exists('is_locked', $data) && $data['is_locked'] !== null) { + if (\array_key_exists('is_locked', $data) && null !== $data['is_locked']) { $object->setIsLocked($data['is_locked']); - } - elseif (\array_key_exists('is_locked', $data) && $data['is_locked'] === null) { + } elseif (\array_key_exists('is_locked', $data) && null === $data['is_locked']) { $object->setIsLocked(null); } - if (\array_key_exists('locked_reason', $data) && $data['locked_reason'] !== null) { + if (\array_key_exists('locked_reason', $data) && null !== $data['locked_reason']) { $object->setLockedReason($data['locked_reason']); - } - elseif (\array_key_exists('locked_reason', $data) && $data['locked_reason'] === null) { + } elseif (\array_key_exists('locked_reason', $data) && null === $data['locked_reason']) { $object->setLockedReason(null); } - if (\array_key_exists('is_closed', $data) && $data['is_closed'] !== null) { + if (\array_key_exists('is_closed', $data) && null !== $data['is_closed']) { $object->setIsClosed($data['is_closed']); - } - elseif (\array_key_exists('is_closed', $data) && $data['is_closed'] === null) { + } elseif (\array_key_exists('is_closed', $data) && null === $data['is_closed']) { $object->setIsClosed(null); } - if (\array_key_exists('is_billed', $data) && $data['is_billed'] !== null) { + if (\array_key_exists('is_billed', $data) && null !== $data['is_billed']) { $object->setIsBilled($data['is_billed']); - } - elseif (\array_key_exists('is_billed', $data) && $data['is_billed'] === null) { + } elseif (\array_key_exists('is_billed', $data) && null === $data['is_billed']) { $object->setIsBilled(null); } - if (\array_key_exists('timer_started_at', $data) && $data['timer_started_at'] !== 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'])); - } - elseif (\array_key_exists('timer_started_at', $data) && $data['timer_started_at'] === null) { + } elseif (\array_key_exists('timer_started_at', $data) && null === $data['timer_started_at']) { $object->setTimerStartedAt(null); } - if (\array_key_exists('started_time', $data) && $data['started_time'] !== null) { + if (\array_key_exists('started_time', $data) && null !== $data['started_time']) { $object->setStartedTime($data['started_time']); - } - elseif (\array_key_exists('started_time', $data) && $data['started_time'] === null) { + } elseif (\array_key_exists('started_time', $data) && null === $data['started_time']) { $object->setStartedTime(null); } - if (\array_key_exists('ended_time', $data) && $data['ended_time'] !== null) { + if (\array_key_exists('ended_time', $data) && null !== $data['ended_time']) { $object->setEndedTime($data['ended_time']); - } - elseif (\array_key_exists('ended_time', $data) && $data['ended_time'] === null) { + } elseif (\array_key_exists('ended_time', $data) && null === $data['ended_time']) { $object->setEndedTime(null); } - if (\array_key_exists('is_running', $data) && $data['is_running'] !== null) { + if (\array_key_exists('is_running', $data) && null !== $data['is_running']) { $object->setIsRunning($data['is_running']); - } - elseif (\array_key_exists('is_running', $data) && $data['is_running'] === null) { + } elseif (\array_key_exists('is_running', $data) && null === $data['is_running']) { $object->setIsRunning(null); } - if (\array_key_exists('billable', $data) && $data['billable'] !== null) { + if (\array_key_exists('billable', $data) && null !== $data['billable']) { $object->setBillable($data['billable']); - } - elseif (\array_key_exists('billable', $data) && $data['billable'] === null) { + } elseif (\array_key_exists('billable', $data) && null === $data['billable']) { $object->setBillable(null); } - if (\array_key_exists('budgeted', $data) && $data['budgeted'] !== null) { + if (\array_key_exists('budgeted', $data) && null !== $data['budgeted']) { $object->setBudgeted($data['budgeted']); - } - elseif (\array_key_exists('budgeted', $data) && $data['budgeted'] === null) { + } elseif (\array_key_exists('budgeted', $data) && null === $data['budgeted']) { $object->setBudgeted(null); } - if (\array_key_exists('billable_rate', $data) && $data['billable_rate'] !== null) { + if (\array_key_exists('billable_rate', $data) && null !== $data['billable_rate']) { $object->setBillableRate($data['billable_rate']); - } - elseif (\array_key_exists('billable_rate', $data) && $data['billable_rate'] === null) { + } elseif (\array_key_exists('billable_rate', $data) && null === $data['billable_rate']) { $object->setBillableRate(null); } - if (\array_key_exists('cost_rate', $data) && $data['cost_rate'] !== null) { + if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); - } - elseif (\array_key_exists('cost_rate', $data) && $data['cost_rate'] === null) { + } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -296,6 +288,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryProjectNormalizer.php b/generated/Normalizer/TimeEntryProjectNormalizer.php index 60d176e..70d670c 100644 --- a/generated/Normalizer/TimeEntryProjectNormalizer.php +++ b/generated/Normalizer/TimeEntryProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryProject' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryTaskNormalizer.php b/generated/Normalizer/TimeEntryTaskNormalizer.php index 39ead55..7473e6a 100644 --- a/generated/Normalizer/TimeEntryTaskNormalizer.php +++ b/generated/Normalizer/TimeEntryTaskNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryTaskNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryTask' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeEntryUserNormalizer.php b/generated/Normalizer/TimeEntryUserNormalizer.php index 292372c..e2c60aa 100644 --- a/generated/Normalizer/TimeEntryUserNormalizer.php +++ b/generated/Normalizer/TimeEntryUserNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeEntryUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeEntryUser' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeReportsResultNormalizer.php b/generated/Normalizer/TimeReportsResultNormalizer.php index 5200ad1..4ecfa3d 100644 --- a/generated/Normalizer/TimeReportsResultNormalizer.php +++ b/generated/Normalizer/TimeReportsResultNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeReportsResultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,92 +55,84 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('client_name', $data) && $data['client_name'] !== null) { + if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); - } - elseif (\array_key_exists('client_name', $data) && $data['client_name'] === null) { + } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('project_name', $data) && $data['project_name'] !== null) { + if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); - } - elseif (\array_key_exists('project_name', $data) && $data['project_name'] === null) { + } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } - if (\array_key_exists('task_id', $data) && $data['task_id'] !== null) { + if (\array_key_exists('task_id', $data) && null !== $data['task_id']) { $object->setTaskId($data['task_id']); - } - elseif (\array_key_exists('task_id', $data) && $data['task_id'] === null) { + } elseif (\array_key_exists('task_id', $data) && null === $data['task_id']) { $object->setTaskId(null); } - if (\array_key_exists('task_name', $data) && $data['task_name'] !== null) { + if (\array_key_exists('task_name', $data) && null !== $data['task_name']) { $object->setTaskName($data['task_name']); - } - elseif (\array_key_exists('task_name', $data) && $data['task_name'] === null) { + } elseif (\array_key_exists('task_name', $data) && null === $data['task_name']) { $object->setTaskName(null); } - if (\array_key_exists('user_id', $data) && $data['user_id'] !== null) { + if (\array_key_exists('user_id', $data) && null !== $data['user_id']) { $object->setUserId($data['user_id']); - } - elseif (\array_key_exists('user_id', $data) && $data['user_id'] === null) { + } elseif (\array_key_exists('user_id', $data) && null === $data['user_id']) { $object->setUserId(null); } - if (\array_key_exists('user_name', $data) && $data['user_name'] !== null) { + if (\array_key_exists('user_name', $data) && null !== $data['user_name']) { $object->setUserName($data['user_name']); - } - elseif (\array_key_exists('user_name', $data) && $data['user_name'] === null) { + } elseif (\array_key_exists('user_name', $data) && null === $data['user_name']) { $object->setUserName(null); } - if (\array_key_exists('is_contractor', $data) && $data['is_contractor'] !== null) { + if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); - } - elseif (\array_key_exists('is_contractor', $data) && $data['is_contractor'] === null) { + } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } - if (\array_key_exists('total_hours', $data) && $data['total_hours'] !== null) { + if (\array_key_exists('total_hours', $data) && null !== $data['total_hours']) { $object->setTotalHours($data['total_hours']); - } - elseif (\array_key_exists('total_hours', $data) && $data['total_hours'] === null) { + } elseif (\array_key_exists('total_hours', $data) && null === $data['total_hours']) { $object->setTotalHours(null); } - if (\array_key_exists('billable_hours', $data) && $data['billable_hours'] !== null) { + if (\array_key_exists('billable_hours', $data) && null !== $data['billable_hours']) { $object->setBillableHours($data['billable_hours']); - } - elseif (\array_key_exists('billable_hours', $data) && $data['billable_hours'] === null) { + } elseif (\array_key_exists('billable_hours', $data) && null === $data['billable_hours']) { $object->setBillableHours(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('billable_amount', $data) && $data['billable_amount'] !== null) { + if (\array_key_exists('billable_amount', $data) && null !== $data['billable_amount']) { $object->setBillableAmount($data['billable_amount']); - } - elseif (\array_key_exists('billable_amount', $data) && $data['billable_amount'] === null) { + } elseif (\array_key_exists('billable_amount', $data) && null === $data['billable_amount']) { $object->setBillableAmount(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -167,6 +172,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getBillableAmount()) { $data['billable_amount'] = $object->getBillableAmount(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/TimeReportsResultsNormalizer.php b/generated/Normalizer/TimeReportsResultsNormalizer.php index c611e02..0d6092c 100644 --- a/generated/Normalizer/TimeReportsResultsNormalizer.php +++ b/generated/Normalizer/TimeReportsResultsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class TimeReportsResultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults'; + return 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResults' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('results', $data)) { - $values = array(); + $values = []; foreach ($data['results'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\TimeReportsResult', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getResults() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UninvoicedReportResultNormalizer.php b/generated/Normalizer/UninvoicedReportResultNormalizer.php index 5dc8646..dc43c59 100644 --- a/generated/Normalizer/UninvoicedReportResultNormalizer.php +++ b/generated/Normalizer/UninvoicedReportResultNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UninvoicedReportResultNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult'; + return 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,68 +55,64 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('client_id', $data) && $data['client_id'] !== null) { + if (\array_key_exists('client_id', $data) && null !== $data['client_id']) { $object->setClientId($data['client_id']); - } - elseif (\array_key_exists('client_id', $data) && $data['client_id'] === null) { + } elseif (\array_key_exists('client_id', $data) && null === $data['client_id']) { $object->setClientId(null); } - if (\array_key_exists('client_name', $data) && $data['client_name'] !== null) { + if (\array_key_exists('client_name', $data) && null !== $data['client_name']) { $object->setClientName($data['client_name']); - } - elseif (\array_key_exists('client_name', $data) && $data['client_name'] === null) { + } elseif (\array_key_exists('client_name', $data) && null === $data['client_name']) { $object->setClientName(null); } - if (\array_key_exists('project_id', $data) && $data['project_id'] !== null) { + if (\array_key_exists('project_id', $data) && null !== $data['project_id']) { $object->setProjectId($data['project_id']); - } - elseif (\array_key_exists('project_id', $data) && $data['project_id'] === null) { + } elseif (\array_key_exists('project_id', $data) && null === $data['project_id']) { $object->setProjectId(null); } - if (\array_key_exists('project_name', $data) && $data['project_name'] !== null) { + if (\array_key_exists('project_name', $data) && null !== $data['project_name']) { $object->setProjectName($data['project_name']); - } - elseif (\array_key_exists('project_name', $data) && $data['project_name'] === null) { + } elseif (\array_key_exists('project_name', $data) && null === $data['project_name']) { $object->setProjectName(null); } - if (\array_key_exists('currency', $data) && $data['currency'] !== null) { + if (\array_key_exists('currency', $data) && null !== $data['currency']) { $object->setCurrency($data['currency']); - } - elseif (\array_key_exists('currency', $data) && $data['currency'] === null) { + } elseif (\array_key_exists('currency', $data) && null === $data['currency']) { $object->setCurrency(null); } - if (\array_key_exists('total_hours', $data) && $data['total_hours'] !== null) { + if (\array_key_exists('total_hours', $data) && null !== $data['total_hours']) { $object->setTotalHours($data['total_hours']); - } - elseif (\array_key_exists('total_hours', $data) && $data['total_hours'] === null) { + } elseif (\array_key_exists('total_hours', $data) && null === $data['total_hours']) { $object->setTotalHours(null); } - if (\array_key_exists('uninvoiced_hours', $data) && $data['uninvoiced_hours'] !== null) { + if (\array_key_exists('uninvoiced_hours', $data) && null !== $data['uninvoiced_hours']) { $object->setUninvoicedHours($data['uninvoiced_hours']); - } - elseif (\array_key_exists('uninvoiced_hours', $data) && $data['uninvoiced_hours'] === null) { + } elseif (\array_key_exists('uninvoiced_hours', $data) && null === $data['uninvoiced_hours']) { $object->setUninvoicedHours(null); } - if (\array_key_exists('uninvoiced_expenses', $data) && $data['uninvoiced_expenses'] !== null) { + if (\array_key_exists('uninvoiced_expenses', $data) && null !== $data['uninvoiced_expenses']) { $object->setUninvoicedExpenses($data['uninvoiced_expenses']); - } - elseif (\array_key_exists('uninvoiced_expenses', $data) && $data['uninvoiced_expenses'] === null) { + } elseif (\array_key_exists('uninvoiced_expenses', $data) && null === $data['uninvoiced_expenses']) { $object->setUninvoicedExpenses(null); } - if (\array_key_exists('uninvoiced_amount', $data) && $data['uninvoiced_amount'] !== null) { + if (\array_key_exists('uninvoiced_amount', $data) && null !== $data['uninvoiced_amount']) { $object->setUninvoicedAmount($data['uninvoiced_amount']); - } - elseif (\array_key_exists('uninvoiced_amount', $data) && $data['uninvoiced_amount'] === null) { + } elseif (\array_key_exists('uninvoiced_amount', $data) && null === $data['uninvoiced_amount']) { $object->setUninvoicedAmount(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getClientId()) { $data['client_id'] = $object->getClientId(); } @@ -131,6 +140,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUninvoicedAmount()) { $data['uninvoiced_amount'] = $object->getUninvoicedAmount(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UninvoicedReportResultsNormalizer.php b/generated/Normalizer/UninvoicedReportResultsNormalizer.php index b786a5f..fe59c79 100644 --- a/generated/Normalizer/UninvoicedReportResultsNormalizer.php +++ b/generated/Normalizer/UninvoicedReportResultsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UninvoicedReportResultsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults'; + return 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResults' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('results', $data)) { - $values = array(); + $values = []; foreach ($data['results'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\UninvoicedReportResult', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getResults() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UserAssignmentNormalizer.php b/generated/Normalizer/UserAssignmentNormalizer.php index 1cd3663..d6be743 100644 --- a/generated/Normalizer/UserAssignmentNormalizer.php +++ b/generated/Normalizer/UserAssignmentNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UserAssignmentNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UserAssignment'; + return 'JoliCode\\Harvest\\Api\\Model\\UserAssignment' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UserAssignment'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignment' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,74 +55,69 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('project', $data) && $data['project'] !== null) { + if (\array_key_exists('project', $data) && null !== $data['project']) { $object->setProject($this->denormalizer->denormalize($data['project'], 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject', 'json', $context)); - } - elseif (\array_key_exists('project', $data) && $data['project'] === null) { + } elseif (\array_key_exists('project', $data) && null === $data['project']) { $object->setProject(null); } - if (\array_key_exists('user', $data) && $data['user'] !== null) { + if (\array_key_exists('user', $data) && null !== $data['user']) { $object->setUser($this->denormalizer->denormalize($data['user'], 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser', 'json', $context)); - } - elseif (\array_key_exists('user', $data) && $data['user'] === null) { + } elseif (\array_key_exists('user', $data) && null === $data['user']) { $object->setUser(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] !== null) { + if (\array_key_exists('is_project_manager', $data) && null !== $data['is_project_manager']) { $object->setIsProjectManager($data['is_project_manager']); - } - elseif (\array_key_exists('is_project_manager', $data) && $data['is_project_manager'] === null) { + } elseif (\array_key_exists('is_project_manager', $data) && null === $data['is_project_manager']) { $object->setIsProjectManager(null); } - if (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] !== null) { + if (\array_key_exists('use_default_rates', $data) && null !== $data['use_default_rates']) { $object->setUseDefaultRates($data['use_default_rates']); - } - elseif (\array_key_exists('use_default_rates', $data) && $data['use_default_rates'] === null) { + } elseif (\array_key_exists('use_default_rates', $data) && null === $data['use_default_rates']) { $object->setUseDefaultRates(null); } - if (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] !== null) { + if (\array_key_exists('hourly_rate', $data) && null !== $data['hourly_rate']) { $object->setHourlyRate($data['hourly_rate']); - } - elseif (\array_key_exists('hourly_rate', $data) && $data['hourly_rate'] === null) { + } elseif (\array_key_exists('hourly_rate', $data) && null === $data['hourly_rate']) { $object->setHourlyRate(null); } - if (\array_key_exists('budget', $data) && $data['budget'] !== null) { + if (\array_key_exists('budget', $data) && null !== $data['budget']) { $object->setBudget($data['budget']); - } - elseif (\array_key_exists('budget', $data) && $data['budget'] === null) { + } elseif (\array_key_exists('budget', $data) && null === $data['budget']) { $object->setBudget(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -140,6 +148,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UserAssignmentProjectNormalizer.php b/generated/Normalizer/UserAssignmentProjectNormalizer.php index cd56b74..cd56ab2 100644 --- a/generated/Normalizer/UserAssignmentProjectNormalizer.php +++ b/generated/Normalizer/UserAssignmentProjectNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UserAssignmentProjectNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject'; + return 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentProject' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } - if (\array_key_exists('code', $data) && $data['code'] !== null) { + if (\array_key_exists('code', $data) && null !== $data['code']) { $object->setCode($data['code']); - } - elseif (\array_key_exists('code', $data) && $data['code'] === null) { + } elseif (\array_key_exists('code', $data) && null === $data['code']) { $object->setCode(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -77,6 +92,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getCode()) { $data['code'] = $object->getCode(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UserAssignmentUserNormalizer.php b/generated/Normalizer/UserAssignmentUserNormalizer.php index db0d839..0973284 100644 --- a/generated/Normalizer/UserAssignmentUserNormalizer.php +++ b/generated/Normalizer/UserAssignmentUserNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UserAssignmentUserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser'; + return 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignmentUser' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,32 +55,36 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('name', $data) && $data['name'] !== null) { + if (\array_key_exists('name', $data) && null !== $data['name']) { $object->setName($data['name']); - } - elseif (\array_key_exists('name', $data) && $data['name'] === null) { + } elseif (\array_key_exists('name', $data) && null === $data['name']) { $object->setName(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } if (null !== $object->getName()) { $data['name'] = $object->getName(); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UserAssignmentsNormalizer.php b/generated/Normalizer/UserAssignmentsNormalizer.php index 3bea6da..4dbc958 100644 --- a/generated/Normalizer/UserAssignmentsNormalizer.php +++ b/generated/Normalizer/UserAssignmentsNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UserAssignmentsNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UserAssignments'; + return 'JoliCode\\Harvest\\Api\\Model\\UserAssignments' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UserAssignments'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UserAssignments' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('user_assignments', $data)) { - $values = array(); + $values = []; foreach ($data['user_assignments'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\UserAssignment', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getUserAssignments() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UserNormalizer.php b/generated/Normalizer/UserNormalizer.php index 98003a5..febfdd1 100644 --- a/generated/Normalizer/UserNormalizer.php +++ b/generated/Normalizer/UserNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UserNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\User'; + return 'JoliCode\\Harvest\\Api\\Model\\User' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\User'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\User' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,114 +55,103 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('id', $data) && $data['id'] !== null) { + if (\array_key_exists('id', $data) && null !== $data['id']) { $object->setId($data['id']); - } - elseif (\array_key_exists('id', $data) && $data['id'] === null) { + } elseif (\array_key_exists('id', $data) && null === $data['id']) { $object->setId(null); } - if (\array_key_exists('first_name', $data) && $data['first_name'] !== null) { + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); - } - elseif (\array_key_exists('first_name', $data) && $data['first_name'] === null) { + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } - if (\array_key_exists('last_name', $data) && $data['last_name'] !== null) { + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); - } - elseif (\array_key_exists('last_name', $data) && $data['last_name'] === null) { + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } - if (\array_key_exists('telephone', $data) && $data['telephone'] !== null) { + if (\array_key_exists('telephone', $data) && null !== $data['telephone']) { $object->setTelephone($data['telephone']); - } - elseif (\array_key_exists('telephone', $data) && $data['telephone'] === null) { + } elseif (\array_key_exists('telephone', $data) && null === $data['telephone']) { $object->setTelephone(null); } - if (\array_key_exists('timezone', $data) && $data['timezone'] !== null) { + if (\array_key_exists('timezone', $data) && null !== $data['timezone']) { $object->setTimezone($data['timezone']); - } - elseif (\array_key_exists('timezone', $data) && $data['timezone'] === null) { + } elseif (\array_key_exists('timezone', $data) && null === $data['timezone']) { $object->setTimezone(null); } - if (\array_key_exists('has_access_to_all_future_projects', $data) && $data['has_access_to_all_future_projects'] !== 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']); - } - elseif (\array_key_exists('has_access_to_all_future_projects', $data) && $data['has_access_to_all_future_projects'] === null) { + } 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) && $data['is_contractor'] !== null) { + if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); - } - elseif (\array_key_exists('is_contractor', $data) && $data['is_contractor'] === null) { + } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] !== null) { + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); - } - elseif (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] === null) { + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } - if (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] !== null) { + if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); - } - elseif (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] === null) { + } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } - if (\array_key_exists('cost_rate', $data) && $data['cost_rate'] !== null) { + if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); - } - elseif (\array_key_exists('cost_rate', $data) && $data['cost_rate'] === null) { + } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } - if (\array_key_exists('roles', $data) && $data['roles'] !== null) { - $values = array(); + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; foreach ($data['roles'] as $value) { $values[] = $value; } $object->setRoles($values); - } - elseif (\array_key_exists('roles', $data) && $data['roles'] === null) { + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { $object->setRoles(null); } - if (\array_key_exists('avatar_url', $data) && $data['avatar_url'] !== null) { + if (\array_key_exists('avatar_url', $data) && null !== $data['avatar_url']) { $object->setAvatarUrl($data['avatar_url']); - } - elseif (\array_key_exists('avatar_url', $data) && $data['avatar_url'] === null) { + } elseif (\array_key_exists('avatar_url', $data) && null === $data['avatar_url']) { $object->setAvatarUrl(null); } - if (\array_key_exists('created_at', $data) && $data['created_at'] !== 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'])); - } - elseif (\array_key_exists('created_at', $data) && $data['created_at'] === null) { + } elseif (\array_key_exists('created_at', $data) && null === $data['created_at']) { $object->setCreatedAt(null); } - if (\array_key_exists('updated_at', $data) && $data['updated_at'] !== 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'])); - } - elseif (\array_key_exists('updated_at', $data) && $data['updated_at'] === null) { + } elseif (\array_key_exists('updated_at', $data) && null === $data['updated_at']) { $object->setUpdatedAt(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getId()) { $data['id'] = $object->getId(); } @@ -187,7 +189,7 @@ public function normalize($object, $format = null, array $context = array()) $data['cost_rate'] = $object->getCostRate(); } if (null !== $object->getRoles()) { - $values = array(); + $values = []; foreach ($object->getRoles() as $value) { $values[] = $value; } @@ -202,6 +204,7 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getUpdatedAt()) { $data['updated_at'] = $object->getUpdatedAt()->format('Y-m-d\\TH:i:s\\Z'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UsersNormalizer.php b/generated/Normalizer/UsersNormalizer.php index 028e559..de714c6 100644 --- a/generated/Normalizer/UsersNormalizer.php +++ b/generated/Normalizer/UsersNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UsersNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\Users'; + return 'JoliCode\\Harvest\\Api\\Model\\Users' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\Users'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\Users' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -43,7 +56,7 @@ public function denormalize($data, $class, $format = null, array $context = arra return $object; } if (\array_key_exists('users', $data)) { - $values = array(); + $values = []; foreach ($data['users'] as $value) { $values[] = $this->denormalizer->denormalize($value, 'JoliCode\\Harvest\\Api\\Model\\User', 'json', $context); } @@ -58,16 +71,14 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('total_entries', $data)) { $object->setTotalEntries($data['total_entries']); } - if (\array_key_exists('next_page', $data) && $data['next_page'] !== null) { + if (\array_key_exists('next_page', $data) && null !== $data['next_page']) { $object->setNextPage($data['next_page']); - } - elseif (\array_key_exists('next_page', $data) && $data['next_page'] === null) { + } elseif (\array_key_exists('next_page', $data) && null === $data['next_page']) { $object->setNextPage(null); } - if (\array_key_exists('previous_page', $data) && $data['previous_page'] !== null) { + if (\array_key_exists('previous_page', $data) && null !== $data['previous_page']) { $object->setPreviousPage($data['previous_page']); - } - elseif (\array_key_exists('previous_page', $data) && $data['previous_page'] === null) { + } elseif (\array_key_exists('previous_page', $data) && null === $data['previous_page']) { $object->setPreviousPage(null); } if (\array_key_exists('page', $data)) { @@ -76,15 +87,20 @@ public function denormalize($data, $class, $format = null, array $context = arra if (\array_key_exists('links', $data)) { $object->setLinks($this->denormalizer->denormalize($data['links'], 'JoliCode\\Harvest\\Api\\Model\\PaginationLinks', 'json', $context)); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); - $values = array(); + $data = []; + $values = []; foreach ($object->getUsers() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } @@ -96,6 +112,7 @@ public function normalize($object, $format = null, array $context = array()) $data['previous_page'] = $object->getPreviousPage(); $data['page'] = $object->getPage(); $data['links'] = $this->normalizer->normalize($object->getLinks(), 'json', $context); + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UsersPostBodyNormalizer.php b/generated/Normalizer/UsersPostBodyNormalizer.php index 5b49385..19fcef7 100644 --- a/generated/Normalizer/UsersPostBodyNormalizer.php +++ b/generated/Normalizer/UsersPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UsersPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,84 +55,78 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('first_name', $data) && $data['first_name'] !== null) { + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); - } - elseif (\array_key_exists('first_name', $data) && $data['first_name'] === null) { + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } - if (\array_key_exists('last_name', $data) && $data['last_name'] !== null) { + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); - } - elseif (\array_key_exists('last_name', $data) && $data['last_name'] === null) { + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } - if (\array_key_exists('timezone', $data) && $data['timezone'] !== null) { + if (\array_key_exists('timezone', $data) && null !== $data['timezone']) { $object->setTimezone($data['timezone']); - } - elseif (\array_key_exists('timezone', $data) && $data['timezone'] === null) { + } elseif (\array_key_exists('timezone', $data) && null === $data['timezone']) { $object->setTimezone(null); } - if (\array_key_exists('has_access_to_all_future_projects', $data) && $data['has_access_to_all_future_projects'] !== 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']); - } - elseif (\array_key_exists('has_access_to_all_future_projects', $data) && $data['has_access_to_all_future_projects'] === null) { + } 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) && $data['is_contractor'] !== null) { + if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); - } - elseif (\array_key_exists('is_contractor', $data) && $data['is_contractor'] === null) { + } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] !== null) { + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); - } - elseif (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] === null) { + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } - if (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] !== null) { + if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); - } - elseif (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] === null) { + } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } - if (\array_key_exists('cost_rate', $data) && $data['cost_rate'] !== null) { + if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); - } - elseif (\array_key_exists('cost_rate', $data) && $data['cost_rate'] === null) { + } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } - if (\array_key_exists('roles', $data) && $data['roles'] !== null) { - $values = array(); + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; foreach ($data['roles'] as $value) { $values[] = $value; } $object->setRoles($values); - } - elseif (\array_key_exists('roles', $data) && $data['roles'] === null) { + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { $object->setRoles(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['first_name'] = $object->getFirstName(); $data['last_name'] = $object->getLastName(); $data['email'] = $object->getEmail(); @@ -145,12 +152,13 @@ public function normalize($object, $format = null, array $context = array()) $data['cost_rate'] = $object->getCostRate(); } if (null !== $object->getRoles()) { - $values = array(); + $values = []; foreach ($object->getRoles() as $value) { $values[] = $value; } $data['roles'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php b/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php index 60be646..298de0f 100644 --- a/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdBillableRatesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UsersUserIdBillableRatesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdBillableRatesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,30 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('start_date', $data) && $data['start_date'] !== 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)); - } - elseif (\array_key_exists('start_date', $data) && $data['start_date'] === null) { + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['amount'] = $object->getAmount(); if (null !== $object->getStartDate()) { $data['start_date'] = $object->getStartDate()->format('Y-m-d'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php b/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php index 482b30c..9c18bb6 100644 --- a/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdCostRatesPostBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UsersUserIdCostRatesPostBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody'; + return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdCostRatesPostBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,30 +55,34 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('amount', $data) && $data['amount'] !== null) { + if (\array_key_exists('amount', $data) && null !== $data['amount']) { $object->setAmount($data['amount']); - } - elseif (\array_key_exists('amount', $data) && $data['amount'] === null) { + } elseif (\array_key_exists('amount', $data) && null === $data['amount']) { $object->setAmount(null); } - if (\array_key_exists('start_date', $data) && $data['start_date'] !== 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)); - } - elseif (\array_key_exists('start_date', $data) && $data['start_date'] === null) { + } elseif (\array_key_exists('start_date', $data) && null === $data['start_date']) { $object->setStartDate(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; $data['amount'] = $object->getAmount(); if (null !== $object->getStartDate()) { $data['start_date'] = $object->getStartDate()->format('Y-m-d'); } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php b/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php index 15f094a..61e9aae 100644 --- a/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php +++ b/generated/Normalizer/UsersUserIdPatchBodyNormalizer.php @@ -1,36 +1,49 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Normalizer; use Jane\Component\JsonSchemaRuntime\Reference; use JoliCode\Harvest\Api\Runtime\Normalizer\CheckArray; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class UsersUserIdPatchBodyNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { + use CheckArray; use DenormalizerAwareTrait; use NormalizerAwareTrait; - use CheckArray; - /** - * @return bool - */ - public function supportsDenormalization($data, $type, $format = null) + + public function supportsDenormalization($data, $type, $format = null): bool { - return $type === 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody'; + return 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody' === $type; } - public function supportsNormalization($data, $format = null) + + public function supportsNormalization($data, $format = null): bool { - return is_object($data) && get_class($data) === 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody'; + return \is_object($data) && 'JoliCode\\Harvest\\Api\\Model\\UsersUserIdPatchBody' === \get_class($data); } + /** + * @param mixed $data + * @param mixed $class + * @param mixed|null $format + * * @return mixed */ - public function denormalize($data, $class, $format = null, array $context = array()) + public function denormalize($data, $class, $format = null, array $context = []) { if (isset($data['$ref'])) { return new Reference($data['$ref'], $context['document-origin']); @@ -42,84 +55,78 @@ public function denormalize($data, $class, $format = null, array $context = arra if (null === $data || false === \is_array($data)) { return $object; } - if (\array_key_exists('first_name', $data) && $data['first_name'] !== null) { + if (\array_key_exists('first_name', $data) && null !== $data['first_name']) { $object->setFirstName($data['first_name']); - } - elseif (\array_key_exists('first_name', $data) && $data['first_name'] === null) { + } elseif (\array_key_exists('first_name', $data) && null === $data['first_name']) { $object->setFirstName(null); } - if (\array_key_exists('last_name', $data) && $data['last_name'] !== null) { + if (\array_key_exists('last_name', $data) && null !== $data['last_name']) { $object->setLastName($data['last_name']); - } - elseif (\array_key_exists('last_name', $data) && $data['last_name'] === null) { + } elseif (\array_key_exists('last_name', $data) && null === $data['last_name']) { $object->setLastName(null); } - if (\array_key_exists('email', $data) && $data['email'] !== null) { + if (\array_key_exists('email', $data) && null !== $data['email']) { $object->setEmail($data['email']); - } - elseif (\array_key_exists('email', $data) && $data['email'] === null) { + } elseif (\array_key_exists('email', $data) && null === $data['email']) { $object->setEmail(null); } - if (\array_key_exists('timezone', $data) && $data['timezone'] !== null) { + if (\array_key_exists('timezone', $data) && null !== $data['timezone']) { $object->setTimezone($data['timezone']); - } - elseif (\array_key_exists('timezone', $data) && $data['timezone'] === null) { + } elseif (\array_key_exists('timezone', $data) && null === $data['timezone']) { $object->setTimezone(null); } - if (\array_key_exists('has_access_to_all_future_projects', $data) && $data['has_access_to_all_future_projects'] !== 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']); - } - elseif (\array_key_exists('has_access_to_all_future_projects', $data) && $data['has_access_to_all_future_projects'] === null) { + } 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) && $data['is_contractor'] !== null) { + if (\array_key_exists('is_contractor', $data) && null !== $data['is_contractor']) { $object->setIsContractor($data['is_contractor']); - } - elseif (\array_key_exists('is_contractor', $data) && $data['is_contractor'] === null) { + } elseif (\array_key_exists('is_contractor', $data) && null === $data['is_contractor']) { $object->setIsContractor(null); } - if (\array_key_exists('is_active', $data) && $data['is_active'] !== null) { + if (\array_key_exists('is_active', $data) && null !== $data['is_active']) { $object->setIsActive($data['is_active']); - } - elseif (\array_key_exists('is_active', $data) && $data['is_active'] === null) { + } elseif (\array_key_exists('is_active', $data) && null === $data['is_active']) { $object->setIsActive(null); } - if (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] !== null) { + if (\array_key_exists('weekly_capacity', $data) && null !== $data['weekly_capacity']) { $object->setWeeklyCapacity($data['weekly_capacity']); - } - elseif (\array_key_exists('weekly_capacity', $data) && $data['weekly_capacity'] === null) { + } elseif (\array_key_exists('weekly_capacity', $data) && null === $data['weekly_capacity']) { $object->setWeeklyCapacity(null); } - if (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] !== null) { + if (\array_key_exists('default_hourly_rate', $data) && null !== $data['default_hourly_rate']) { $object->setDefaultHourlyRate($data['default_hourly_rate']); - } - elseif (\array_key_exists('default_hourly_rate', $data) && $data['default_hourly_rate'] === null) { + } elseif (\array_key_exists('default_hourly_rate', $data) && null === $data['default_hourly_rate']) { $object->setDefaultHourlyRate(null); } - if (\array_key_exists('cost_rate', $data) && $data['cost_rate'] !== null) { + if (\array_key_exists('cost_rate', $data) && null !== $data['cost_rate']) { $object->setCostRate($data['cost_rate']); - } - elseif (\array_key_exists('cost_rate', $data) && $data['cost_rate'] === null) { + } elseif (\array_key_exists('cost_rate', $data) && null === $data['cost_rate']) { $object->setCostRate(null); } - if (\array_key_exists('roles', $data) && $data['roles'] !== null) { - $values = array(); + if (\array_key_exists('roles', $data) && null !== $data['roles']) { + $values = []; foreach ($data['roles'] as $value) { $values[] = $value; } $object->setRoles($values); - } - elseif (\array_key_exists('roles', $data) && $data['roles'] === null) { + } elseif (\array_key_exists('roles', $data) && null === $data['roles']) { $object->setRoles(null); } + return $object; } + /** + * @param mixed $object + * @param mixed|null $format + * * @return array|string|int|float|bool|\ArrayObject|null */ - public function normalize($object, $format = null, array $context = array()) + public function normalize($object, $format = null, array $context = []) { - $data = array(); + $data = []; if (null !== $object->getFirstName()) { $data['first_name'] = $object->getFirstName(); } @@ -151,12 +158,13 @@ public function normalize($object, $format = null, array $context = array()) $data['cost_rate'] = $object->getCostRate(); } if (null !== $object->getRoles()) { - $values = array(); + $values = []; foreach ($object->getRoles() as $value) { $values[] = $value; } $data['roles'] = $values; } + return $data; } -} \ No newline at end of file +} diff --git a/generated/Runtime/Client/BaseEndpoint.php b/generated/Runtime/Client/BaseEndpoint.php index 5531b30..2078471 100644 --- a/generated/Runtime/Client/BaseEndpoint.php +++ b/generated/Runtime/Client/BaseEndpoint.php @@ -1,65 +1,91 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Runtime\Client; use Http\Message\MultipartStream\MultipartStreamBuilder; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Serializer\SerializerInterface; + abstract class BaseEndpoint implements Endpoint { protected $queryParameters = []; protected $headerParameters = []; protected $body; - public abstract function getMethod() : string; - public abstract function getBody(SerializerInterface $serializer, $streamFactory = null) : array; - public abstract function getUri() : string; - public abstract function getAuthenticationScopes() : array; - protected abstract function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); - protected function getExtraHeaders() : array - { - return []; - } - public function getQueryString() : string + + abstract public function getMethod(): string; + + abstract public function getBody(SerializerInterface $serializer, $streamFactory = null): array; + + abstract public function getUri(): string; + + abstract public function getAuthenticationScopes(): array; + + public function getQueryString(): string { $optionsResolved = $this->getQueryOptionsResolver()->resolve($this->queryParameters); $optionsResolved = array_map(function ($value) { return null !== $value ? $value : ''; }, $optionsResolved); - return http_build_query($optionsResolved, '', '&', PHP_QUERY_RFC3986); + + return http_build_query($optionsResolved, '', '&', \PHP_QUERY_RFC3986); } - public function getHeaders(array $baseHeaders = []) : array + + public function getHeaders(array $baseHeaders = []): array { return array_merge($this->getExtraHeaders(), $baseHeaders, $this->getHeadersOptionsResolver()->resolve($this->headerParameters)); } - protected function getQueryOptionsResolver() : OptionsResolver + + abstract protected function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); + + protected function getExtraHeaders(): array + { + return []; + } + + protected function getQueryOptionsResolver(): OptionsResolver { return new OptionsResolver(); } - protected function getHeadersOptionsResolver() : OptionsResolver + + protected function getHeadersOptionsResolver(): OptionsResolver { return new OptionsResolver(); } + // ---------------------------------------------------------------------------------------------------- // Used for OpenApi2 compatibility - protected function getFormBody() : array + protected function getFormBody(): array { return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($this->getFormOptionsResolver()->resolve($this->formParameters))]; } - protected function getMultipartBody($streamFactory = null) : array + + protected function getMultipartBody($streamFactory = null): array { $bodyBuilder = new MultipartStreamBuilder($streamFactory); $formParameters = $this->getFormOptionsResolver()->resolve($this->formParameters); foreach ($formParameters as $key => $value) { $bodyBuilder->addResource($key, $value); } - return [['Content-Type' => ['multipart/form-data; boundary="' . ($bodyBuilder->getBoundary() . '"')]], $bodyBuilder->build()]; + + return [['Content-Type' => ['multipart/form-data; boundary="'.($bodyBuilder->getBoundary().'"')]], $bodyBuilder->build()]; } - protected function getFormOptionsResolver() : OptionsResolver + + protected function getFormOptionsResolver(): OptionsResolver { return new OptionsResolver(); } - protected function getSerializedBody(SerializerInterface $serializer) : array + + protected function getSerializedBody(SerializerInterface $serializer): array { return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } -} \ No newline at end of file +} diff --git a/generated/Runtime/Client/Client.php b/generated/Runtime/Client/Client.php index 6c0c7a4..e16a1fa 100644 --- a/generated/Runtime/Client/Client.php +++ b/generated/Runtime/Client/Client.php @@ -1,13 +1,24 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Runtime\Client; use Jane\Component\OpenApiRuntime\Client\Plugin\AuthenticationRegistry; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; +use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\StreamInterface; use Symfony\Component\Serializer\SerializerInterface; + abstract class Client { public const FETCH_RESPONSE = 'response'; @@ -28,6 +39,7 @@ abstract class Client * @var StreamFactoryInterface */ protected $streamFactory; + public function __construct(ClientInterface $httpClient, RequestFactoryInterface $requestFactory, SerializerInterface $serializer, StreamFactoryInterface $streamFactory) { $this->httpClient = $httpClient; @@ -35,19 +47,36 @@ public function __construct(ClientInterface $httpClient, RequestFactoryInterface $this->serializer = $serializer; $this->streamFactory = $streamFactory; } + public function executeEndpoint(Endpoint $endpoint, string $fetch = self::FETCH_OBJECT) + { + if (self::FETCH_RESPONSE === $fetch) { + trigger_deprecation('jane-php/open-api-common', '7.3', 'Using %s::%s method with $fetch parameter equals to response is deprecated, use %s::%s instead.', __CLASS__, __METHOD__, __CLASS__, 'executeRawEndpoint'); + + return $this->executeRawEndpoint($endpoint); + } + + return $endpoint->parseResponse($this->processEndpoint($endpoint), $this->serializer, $fetch); + } + + public function executeRawEndpoint(Endpoint $endpoint): ResponseInterface + { + return $this->processEndpoint($endpoint); + } + + private function processEndpoint(Endpoint $endpoint): ResponseInterface { [$bodyHeaders, $body] = $endpoint->getBody($this->serializer, $this->streamFactory); $queryString = $endpoint->getQueryString(); $uriGlue = false === strpos($endpoint->getUri(), '?') ? '?' : '&'; - $uri = $queryString !== '' ? $endpoint->getUri() . $uriGlue . $queryString : $endpoint->getUri(); + $uri = '' !== $queryString ? $endpoint->getUri().$uriGlue.$queryString : $endpoint->getUri(); $request = $this->requestFactory->createRequest($endpoint->getMethod(), $uri); if ($body) { if ($body instanceof StreamInterface) { $request = $request->withBody($body); - } elseif (is_resource($body)) { + } elseif (\is_resource($body)) { $request = $request->withBody($this->streamFactory->createStreamFromResource($body)); - } elseif (strlen($body) <= 4000 && @file_exists($body)) { + } elseif (\strlen($body) <= 4000 && @file_exists($body)) { // more than 4096 chars will trigger an error $request = $request->withBody($this->streamFactory->createStreamFromFile($body)); } else { @@ -57,13 +86,14 @@ public function executeEndpoint(Endpoint $endpoint, string $fetch = self::FETCH_ foreach ($endpoint->getHeaders($bodyHeaders) as $name => $value) { $request = $request->withHeader($name, $value); } - if (count($endpoint->getAuthenticationScopes()) > 0) { + if (\count($endpoint->getAuthenticationScopes()) > 0) { $scopes = []; foreach ($endpoint->getAuthenticationScopes() as $scope) { $scopes[] = $scope; } $request = $request->withHeader(AuthenticationRegistry::SCOPES_HEADER, $scopes); } - return $endpoint->parseResponse($this->httpClient->sendRequest($request), $this->serializer, $fetch); + + return $this->httpClient->sendRequest($request); } -} \ No newline at end of file +} diff --git a/generated/Runtime/Client/CustomQueryResolver.php b/generated/Runtime/Client/CustomQueryResolver.php index 868c6f4..e3bc0e5 100644 --- a/generated/Runtime/Client/CustomQueryResolver.php +++ b/generated/Runtime/Client/CustomQueryResolver.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Runtime\Client; use Symfony\Component\OptionsResolver\Options; + interface CustomQueryResolver { public function __invoke(Options $options, $value); -} \ No newline at end of file +} diff --git a/generated/Runtime/Client/Endpoint.php b/generated/Runtime/Client/Endpoint.php index cdc10cb..ba82501 100644 --- a/generated/Runtime/Client/Endpoint.php +++ b/generated/Runtime/Client/Endpoint.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Runtime\Client; use Psr\Http\Message\ResponseInterface; use Symfony\Component\Serializer\SerializerInterface; + interface Endpoint { /** @@ -11,32 +21,40 @@ interface Endpoint * * Return value consist of an array where the first item will be a list of headers to add on the request (like the Content Type) * And the second value consist of the body object. + * + * @param mixed|null $streamFactory */ - public function getBody(SerializerInterface $serializer, $streamFactory = null) : array; + public function getBody(SerializerInterface $serializer, $streamFactory = null): array; + /** * Get the query string of an endpoint without the starting ? (like foo=foo&bar=bar). */ - public function getQueryString() : string; + public function getQueryString(): string; + /** * Get the URI of an endpoint (like /foo-uri). */ - public function getUri() : string; + public function getUri(): string; + /** * Get the HTTP method of an endpoint (like GET, POST, ...). */ - public function getMethod() : string; + public function getMethod(): string; + /** * Get the headers of an endpoint. */ - public function getHeaders(array $baseHeaders = []) : array; + public function getHeaders(array $baseHeaders = []): array; + /** * Get security scopes of an endpoint. */ - public function getAuthenticationScopes() : array; + public function getAuthenticationScopes(): array; + /** * Parse and transform a PSR7 Response into a different object. * * Implementations may vary depending the status code of the response and the fetch mode used. */ public function parseResponse(ResponseInterface $response, SerializerInterface $serializer, string $fetchMode = Client::FETCH_OBJECT); -} \ No newline at end of file +} diff --git a/generated/Runtime/Client/EndpointTrait.php b/generated/Runtime/Client/EndpointTrait.php index a69cfd9..cccc956 100644 --- a/generated/Runtime/Client/EndpointTrait.php +++ b/generated/Runtime/Client/EndpointTrait.php @@ -1,22 +1,27 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace JoliCode\Harvest\Api\Runtime\Client; -use Jane\Component\OpenApiRuntime\Client\Exception\InvalidFetchModeException; use Psr\Http\Message\ResponseInterface; use Symfony\Component\Serializer\SerializerInterface; + trait EndpointTrait { - protected abstract function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); public function parseResponse(ResponseInterface $response, SerializerInterface $serializer, string $fetchMode = Client::FETCH_OBJECT) { - if ($fetchMode === Client::FETCH_OBJECT) { - $contentType = $response->hasHeader('Content-Type') ? current($response->getHeader('Content-Type')) : null; - return $this->transformResponseBody((string) $response->getBody(), $response->getStatusCode(), $serializer, $contentType); - } - if ($fetchMode === Client::FETCH_RESPONSE) { - return $response; - } - throw new InvalidFetchModeException(sprintf('Fetch mode %s is not supported', $fetchMode)); + $contentType = $response->hasHeader('Content-Type') ? current($response->getHeader('Content-Type')) : null; + + return $this->transformResponseBody((string) $response->getBody(), $response->getStatusCode(), $serializer, $contentType); } -} \ No newline at end of file + + abstract protected function transformResponseBody(string $body, int $status, SerializerInterface $serializer, ?string $contentType = null); +} diff --git a/generated/Runtime/Normalizer/CheckArray.php b/generated/Runtime/Normalizer/CheckArray.php index 2e546ea..bfe04c2 100644 --- a/generated/Runtime/Normalizer/CheckArray.php +++ b/generated/Runtime/Normalizer/CheckArray.php @@ -1,13 +1,22 @@ + * + * 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; trait CheckArray { - public function isOnlyNumericKeys(array $array) : bool + public function isOnlyNumericKeys(array $array): bool { - return count(array_filter($array, function ($key) { + return \count(array_filter($array, function ($key) { return is_numeric($key); - }, ARRAY_FILTER_USE_KEY)) === count($array); + }, \ARRAY_FILTER_USE_KEY)) === \count($array); } -} \ No newline at end of file +} diff --git a/generated/Runtime/Normalizer/ReferenceNormalizer.php b/generated/Runtime/Normalizer/ReferenceNormalizer.php index feab7d2..9c9a324 100644 --- a/generated/Runtime/Normalizer/ReferenceNormalizer.php +++ b/generated/Runtime/Normalizer/ReferenceNormalizer.php @@ -1,9 +1,19 @@ + * + * 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 Jane\Component\JsonSchemaRuntime\Reference; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + class ReferenceNormalizer implements NormalizerInterface { /** @@ -13,13 +23,15 @@ public function normalize($object, $format = null, array $context = []) { $ref = []; $ref['$ref'] = (string) $object->getReferenceUri(); + return $ref; } + /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null): bool { return $data instanceof Reference; } -} \ No newline at end of file +} From 5c0c5be7b7b1a7ea041740928c099e8731730db3 Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Thu, 4 Aug 2022 12:24:01 +0200 Subject: [PATCH 2/3] update the changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 196116d..10baf8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changes between versions +## 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.). + ## 5.2.0 (2022-01-10) * upgraded `janephp/open-api` from 6.3 to 7.1 - thanks @jdrieghe From 8ad91cd5d12c4746df830e1e51fa7babd6e56c7b Mon Sep 17 00:00:00 2001 From: Xavier Lacot Date: Thu, 4 Aug 2022 12:25:38 +0200 Subject: [PATCH 3/3] updated tests targets --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e06fd8..55ac6ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: strategy: max-parallel: 15 matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout uses: actions/checkout@v2